1. Pypy
  2. Untitled project
  3. pypy

Commits

Maciej Fijalkowski  committed b1d924a

fix

  • Participants
  • Parent commits 42ae84d
  • Branches default

Comments (0)

Files changed (2)

File rpython/jit/backend/x86/test/test_zrpy_releasegil.py

View file
     def define_simple(self):
         class Glob:
             def __init__(self):
-                glob.event = 0
+                self.event = 0
         glob = Glob()
         #
 

File rpython/rtyper/test/test_rptr.py

View file
     res = interpret(f, [])
     assert res == 1
 
+def test_interior_ptr_convert():
+    S = lltype.Struct("S", ("x", lltype.Signed))
+    T = lltype.GcArray(S)
+    def f(i):
+        t = lltype.malloc(T, 2)
+        if i:
+            x = t[0]
+        else:
+            x = t[1]
+        x.x = 3
+        return t[0].x
+
+    res = interpret(f, [13])
+    assert res == 3
+
 def test_interior_ptr_with_field_and_index():
     S = lltype.Struct("S", ('x', lltype.Signed))
     T = lltype.GcStruct("T", ('items', lltype.Array(S)))