[pypy-svn] pypy post-release-1.5: A precise check: when we attach a bridge to a guard, check

arigo commits-noreply at bitbucket.org
Tue Apr 26 17:43:26 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: post-release-1.5
Changeset: r43636:75fa8b0f2ba5
Date: 2011-04-26 17:43 +0200
http://bitbucket.org/pypy/pypy/changeset/75fa8b0f2ba5/

Log:	A precise check: when we attach a bridge to a guard, check that the
	provided arguments match the number and types of the fail_args-
	without-the-Nones.

diff --git a/pypy/jit/backend/llgraph/llimpl.py b/pypy/jit/backend/llgraph/llimpl.py
--- a/pypy/jit/backend/llgraph/llimpl.py
+++ b/pypy/jit/backend/llgraph/llimpl.py
@@ -407,6 +407,13 @@
     guard_op = old_loop.operations[old_index]
     assert guard_op.is_guard()
     guard_op.jump_target = new_loop
+    # check that the bridge's inputargs are of the correct number and
+    # kind for the guard
+    if guard_op.fail_args is not None:
+        argkinds = [v.concretetype for v in guard_op.fail_args if v]
+    else:
+        argkinds = []
+    assert argkinds == [v.concretetype for v in new_loop.inputargs]
 
 # ------------------------------
 


More information about the Pypy-commit mailing list