Author: Armin Rigo <[email protected]>
Branch:
Changeset: r88685:a86ded88180d
Date: 2016-11-27 22:38 +0100
http://bitbucket.org/pypy/pypy/changeset/a86ded88180d/
Log: Force right-shifts to be done on 64-bit values: otherwise,
translating on 32-bit in lldebug mode crashes (and, in non-debug
mode, can produce undefined behavior).
diff --git a/rpython/rlib/rjitlog/rjitlog.py b/rpython/rlib/rjitlog/rjitlog.py
--- a/rpython/rlib/rjitlog/rjitlog.py
+++ b/rpython/rlib/rjitlog/rjitlog.py
@@ -13,6 +13,7 @@
from rpython.jit.metainterp.resoperation import rop
from rpython.jit.metainterp.history import ConstInt, ConstFloat
from rpython.rlib.objectmodel import we_are_translated
+from rpython.rlib.rarithmetic import r_longlong
from rpython.rtyper.lltypesystem import lltype, llmemory, rffi
from rpython.rlib.objectmodel import compute_unique_id, always_inline
from rpython.rlib.objectmodel import we_are_translated, specialize
@@ -113,6 +114,7 @@
@always_inline
def encode_le_64bit(val):
+ val = r_longlong(val) # force 64-bit, even on 32-bit
return ''.join([chr((val >> 0) & 0xff),
chr((val >> 8) & 0xff),
chr((val >> 16) & 0xff),
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit