Author: Ronan Lamy <[email protected]>
Branch: exc-later
Changeset: r80532:433f4c50738d
Date: 2015-11-04 02:16 +0000
http://bitbucket.org/pypy/pypy/changeset/433f4c50738d/

Log:    Fix detection of suitable exception links in
        GraphFlattener.make_exception_link()

diff --git a/rpython/jit/codewriter/flatten.py 
b/rpython/jit/codewriter/flatten.py
--- a/rpython/jit/codewriter/flatten.py
+++ b/rpython/jit/codewriter/flatten.py
@@ -160,8 +160,13 @@
         # is jumping directly to the re-raising exception block.
         assert link.last_exception is not None
         assert link.last_exc_value is not None
-        if link.target.operations == () and link.args == [link.last_exception,
-                                                          link.last_exc_value]:
+        def equals(a , b):
+            return (a == b or
+                    isinstance(a, Constant) and isinstance(b, Constant) and
+                    a.value == b.value)
+        if (link.target.operations == () and len(link.args) == 2 and
+                equals(link.args[0] , link.last_exception) and
+                equals(link.args[1], link.last_exc_value)):
             if handling_ovf:
                 exc_data = self.cpu.rtyper.exceptiondata
                 ll_ovf = exc_data.get_standard_ll_exc_instance_by_class(
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to