1. Pypy
  2. Untitled project
  3. pypy


Armin Rigo  committed ffe7dd8

Fixes: in raw_load/raw_store, we don't know what kind of type the 1st argument has. It could be a GCREF, or a Signed or an

  • Participants
  • Parent commits 1b6f11c
  • Branches stmgc-c4

Comments (0)

Files changed (2)

File rpython/translator/stm/inevitable.py

View file
  • Ignore whitespace
     # If it is a RAW pointer, and it is a read from a non-immutable place,
     # and it doesn't use the hint 'stm_dont_track_raw_accesses', then they
     # turn inevitable.
-    S = op.args[0].concretetype.TO
+    TYPE = op.args[0].concretetype
+    if not isinstance(TYPE, lltype.Ptr):
+        return True     # raw_load or raw_store with a number or address
+    S = TYPE.TO
     if S._gckind == 'gc':
         return False
     if is_immutable(op):

File rpython/translator/stm/writebarrier.py

View file
  • Ignore whitespace
     if op.opname in ('getfield', 'setfield'):
         STRUCT = op.args[0].concretetype.TO
         return STRUCT._immutable_field(op.args[1].value)
-    if op.opname in ('getarrayitem', 'setarrayitem', 'raw_load', 'raw_store'):
+    if op.opname in ('getarrayitem', 'setarrayitem'):
         ARRAY = op.args[0].concretetype.TO
         return ARRAY._immutable_field()
     if op.opname == 'getinteriorfield':
     if op.opname == 'setinteriorfield':
         OUTER = op.args[0].concretetype.TO
         return OUTER._immutable_interiorfield(unwraplist(op.args[1:-1]))
+    if op.opname in ('raw_load', 'raw_store'):
+        return False
     raise AssertionError(op)
 def needs_barrier(frm, to):