diff Objects/object.c @ 22146:db040938dc66 2.2

Backport the bits of Guido's fix for SF patch 514641 (Naofumi Honda) - Negative ob_size of LongObjects that Tim didn't later back out.
author Michael W. Hudson <mwh@python.net>
date Tue, 05 Mar 2002 15:41:40 +0000
parents 4ff9f8a74c82
children 82460fda4f76
line wrap: on
line diff
--- a/Objects/object.c	Tue Mar 05 15:38:43 2002 +0000
+++ b/Objects/object.c	Tue Mar 05 15:41:40 2002 +0000
@@ -1191,8 +1191,14 @@
 	if (dictoffset == 0)
 		return NULL;
 	if (dictoffset < 0) {
-		const size_t size = _PyObject_VAR_SIZE(tp,
-					((PyVarObject *)obj)->ob_size);
+		int tsize;
+		size_t size;
+
+		tsize = ((PyVarObject *)obj)->ob_size;
+		if (tsize < 0)
+			tsize = -tsize;
+		size = _PyObject_VAR_SIZE(tp, tsize);
+
 		dictoffset += (long)size;
 		assert(dictoffset > 0);
 		assert(dictoffset % SIZEOF_VOID_P == 0);