Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r96015:8d12729e7465
Date: 2019-02-15 12:45 +0100
http://bitbucket.org/pypy/pypy/changeset/8d12729e7465/

Log:    fix rsre_core.py (hard to test for, as it was working in non-
        translated tests but accidentally killing the second half of the
        method after translation)

diff --git a/rpython/rlib/rsre/rsre_core.py b/rpython/rlib/rsre/rsre_core.py
--- a/rpython/rlib/rsre/rsre_core.py
+++ b/rpython/rlib/rsre/rsre_core.py
@@ -151,7 +151,10 @@
     # The following methods are provided to be overriden in
     # Utf8MatchContext.  The non-utf8 implementation is provided
     # by the FixedMatchContext abstract subclass, in order to use
-    # the same @not_rpython safety trick as above.
+    # the same @not_rpython safety trick as above.  If you get a
+    # "not_rpython" error during translation, either consider
+    # calling the methods xxx_indirect() instead of xxx(), or if
+    # applicable add the @specializectx decorator.
     ZERO = 0
     @not_rpython
     def next(self, position):
@@ -460,8 +463,7 @@
         ptr = self.start_ptr
         if not self.next_char_ok(ctx, pattern, ptr, self.ppos3):
             return
-        assert not isinstance(ctx, AbstractMatchContext)
-        self.start_ptr = ctx.next(ptr)
+        self.start_ptr = ctx.next_indirect(ptr)
         return self.find_first_result(ctx, pattern)
 
     def next_char_ok(self, ctx, pattern, ptr, ppos):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to