Commits

Philip Jenvey committed 4fa4c6b

lame and mysterious workaround for -Ojit & --objspace-std-withsmalllong failing
translation

  • Participants
  • Parent commits e677ccd
  • Branches remove-intlong-smm

Comments (0)

Files changed (1)

pypy/objspace/std/smalllongobject.py

 from pypy.objspace.std.intobject import W_AbstractIntObject
 from pypy.objspace.std.longobject import W_AbstractLongObject, W_LongObject
 
-LONGLONG_MIN = r_longlong(-1 << (LONGLONG_BIT - 1))
+# XXX: breaks translation
+#LONGLONG_MIN = r_longlong(-1 << (LONGLONG_BIT - 1))
 
 
 class W_SmallLongObject(W_AbstractLongObject):
         x = self.longlong
         y = w_other.longlong
         try:
-            if y == -1 and x == LONGLONG_MIN:
+            if y == -1 and x == r_longlong(-1 << (LONGLONG_BIT-1)):
                 raise OverflowError
             z = x // y
         except ZeroDivisionError:
         x = self.longlong
         y = w_other.longlong
         try:
-            if y == -1 and x == LONGLONG_MIN:
+            if y == -1 and x == r_longlong(-1 << (LONGLONG_BIT-1)):
                 raise OverflowError
             z = x % y
         except ZeroDivisionError:
         x = self.longlong
         y = w_other.longlong
         try:
-            if y == -1 and x == LONGLONG_MIN:
+            if y == -1 and x == r_longlong(-1 << (LONGLONG_BIT-1)):
                 raise OverflowError
             z = x // y
         except ZeroDivisionError:
 
         if space.is_none(w_modulus):
             try:
-                return _pow_impl(space, self.longlong, w_exponent)
+                return _pow_impl(space, self.longlong, w_exponent,
+                                 r_longlong(0))
             except ValueError:
                 self = self.descr_float(space)
                 return space.pow(self, w_exponent, space.w_None)
     def descr_neg(self, space):
         a = self.longlong
         try:
-            if a == LONGLONG_MIN:
+            if a == r_longlong(-1 << (LONGLONG_BIT-1)):
                 raise OverflowError
             x = -a
         except OverflowError:
     return space.newtuple([div_ovr(space, w_int1, w_int2),
                            mod_ovr(space, w_int1, w_int2)])
 
-def _pow_impl(space, iv, w_int2, iz=r_longlong(0)):
+def _pow_impl(space, iv, w_int2, iz):
     iw = space.int_w(w_int2)
     if iw < 0:
         if iz != 0: