[Zodb-checkins] CVS: ZODB3/ExtensionClass/src - ExtensionClass.c:1.58.34.1

Tim Peters tim.one at comcast.net
Fri Aug 15 14:26:14 EDT 2003


Update of /cvs-repository/ZODB3/ExtensionClass/src
In directory cvs.zope.org:/tmp/cvs-serv15484/ExtensionClass/src

Modified Files:
      Tag: ZODB3-3_2-branch
	ExtensionClass.c 
Log Message:
subclass_compare():  As reported by Neil Schemenauer, instances of
an ExtensionClass type that get into this code can raise RuntimeWarning
under Python 2.3, because the comparison result may be outside the
set {-1, 0, 1}.  Worse, on a box where sizeof(ptrdiff_t) > sizeof(int)
(all 64-bit platforms), comparison results across a set of objects
could be inconsistent because the implicit cast of pointer subtraction
to int loses the information-carrying sign bit.


=== ZODB3/ExtensionClass/src/ExtensionClass.c 1.58 => 1.58.34.1 ===
--- ZODB3/ExtensionClass/src/ExtensionClass.c:1.58	Tue Nov 12 15:04:20 2002
+++ ZODB3/ExtensionClass/src/ExtensionClass.c	Fri Aug 15 13:26:08 2003
@@ -2299,7 +2299,7 @@
   UNLESS(m=subclass_getspecial(self,py__cmp__))
     {
       PyErr_Clear();
-      return self-v;
+      return self < v ? -1 : (self != v);
     }
 
   if (UnboundCMethod_Check(m)




More information about the Zodb-checkins mailing list