1. Pypy
  2. Untitled project
  3. pypy

Commits

Armin Rigo  committed 3ae2e08

Fixes

  • Participants
  • Parent commits 2982c43
  • Branches default

Comments (0)

Files changed (2)

File rpython/jit/backend/test/test_ll_random.py

View file
  • Ignore whitespace
         self.vtable_counter += 1
         S = self.get_random_structure_type(r, with_vtable=vtable, cache=False)
         name = S._name
-        vtable.name = lltype.malloc(lltype.Array(lltype.Char), len(name)+1,
-                                    immortal=True)
-        for i in range(len(name)):
-            vtable.name[i] = name[i]
-        vtable.name[len(name)] = '\x00'
+        vtable.name = rstr.string_repr.convert_const(name)
         self.structure_types_and_vtables.append((S, vtable))
         #
         heaptracker.register_known_gctype(self.cpu, vtable, S)

File rpython/jit/metainterp/optimizeopt/test/test_util.py

View file
  • Ignore whitespace
         return box.getref(rclass.OBJECTPTR).typeptr
 
     node_vtable = lltype.malloc(OBJECT_VTABLE, immortal=True)
-    node_vtable.name = rclass.alloc_array_name('node')
+    node_vtable.name = rstr.string_repr.convert_const('node')
     node_vtable_adr = llmemory.cast_ptr_to_adr(node_vtable)
     node_vtable2 = lltype.malloc(OBJECT_VTABLE, immortal=True)
-    node_vtable2.name = rclass.alloc_array_name('node2')
+    node_vtable2.name = rstr.string_repr.convert_const('node2')
     node_vtable_adr2 = llmemory.cast_ptr_to_adr(node_vtable2)
     cpu = runner.LLGraphCPU(None)
 
     def get_name_from_address(self, addr):
         # hack
         try:
-            return "".join(addr.ptr.name)[:-1] # remove \x00
+            return "".join(addr.ptr.name.chars)
         except AttributeError:
             return ""