Author: Armin Rigo <[email protected]>
Branch: reverse-debugger
Changeset: r86786:2c419984a223
Date: 2016-08-31 18:52 +0200
http://bitbucket.org/pypy/pypy/changeset/2c419984a223/

Log:    Translation fixes

diff --git a/pypy/interpreter/reverse_debugging.py 
b/pypy/interpreter/reverse_debugging.py
--- a/pypy/interpreter/reverse_debugging.py
+++ b/pypy/interpreter/reverse_debugging.py
@@ -206,7 +206,8 @@
     p = 0
     result = []
     while p < len(lnotab) - 1:
-        byte_incr = ord(lnotab[p])
+        byte_incr = ord(lnotab[p + 0])
+        line_incr = ord(lnotab[p + 1])
         if byte_incr:
             if lineno != lastlineno:
                 result.append((addr, lineno))
@@ -559,6 +560,7 @@
         # normalize co_filename, and assigns the {lineno: bkpt_num} dict
         # back over the original key, to avoid calling rabspath/rnormpath
         # again the next time
+        co_filename = rstring.assert_str0(co_filename)
         normfilename = rpath.rabspath(co_filename)
         normfilename = rpath.rnormpath(normfilename)
         linenos = dbstate.breakpoint_filelines.get(normfilename, None)
@@ -611,7 +613,8 @@
     # if it has no ':', it can be a valid identifier (which we
     # register as a function name), or a lineno
     original_name = name
-    if ':' not in name:
+    j = name.rfind(':')
+    if j < 0:
         try:
             lineno = int(name)
         except ValueError:
@@ -625,7 +628,6 @@
         filename = ''
     else:
         # if it has a ':', it must end in ':lineno'
-        j = name.rfind(':')
         try:
             lineno = int(name[j+1:])
         except ValueError:
diff --git a/pypy/module/_cffi_backend/func.py 
b/pypy/module/_cffi_backend/func.py
--- a/pypy/module/_cffi_backend/func.py
+++ b/pypy/module/_cffi_backend/func.py
@@ -179,7 +179,8 @@
     rawbytes = cache.wdict.get(w_x)
     if rawbytes is None:
         data = space.str_w(w_x)
-        if we_are_translated() and not rgc.can_move(data):
+        if (we_are_translated() and not rgc.can_move(data)
+                                and not rgc.must_split_gc_address_space()):
             lldata = llstr(data)
             data_start = (llmemory.cast_ptr_to_adr(lldata) +
                           rffi.offsetof(STR, 'chars') +
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to