Commits

Carl Friedrich Bolz  committed 4c46422

move an ll_assert around: cast_ptr_to_int *can* be used on an even pointer (to
check whether it is tagged). however, int_untag should really only be used on
odd numbers.

  • Participants
  • Parent commits 1bab583
  • Branches int-tag-untag-as-operations

Comments (0)

Files changed (1)

File pypy/jit/metainterp/blackhole.py

 
     @arguments("i", returns="i")
     def bhimpl_int_untag(a):
+        ll_assert((a & 1) == 1, "bhimpl_int_untag: not an odd int")
         return a >> 1
     @arguments("i", returns="i")
     def bhimpl_int_tag(a):
     @arguments("r", returns="i")
     def bhimpl_cast_ptr_to_int(a):
         i = lltype.cast_ptr_to_int(a)
-        ll_assert((i & 1) == 1, "bhimpl_cast_ptr_to_int: not an odd int")
         return i
     @arguments("i", returns="r")
     def bhimpl_cast_int_to_ptr(i):