[pypy-commit] pypy expressions: fix checkgraph()
rlamy
noreply at buildbot.pypy.org
Tue Nov 11 02:39:04 CET 2014
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: expressions
Changeset: r74438:d811881dde09
Date: 2014-11-09 03:04 +0000
http://bitbucket.org/pypy/pypy/changeset/d811881dde09/
Log: fix checkgraph()
diff --git a/rpython/flowspace/model.py b/rpython/flowspace/model.py
--- a/rpython/flowspace/model.py
+++ b/rpython/flowspace/model.py
@@ -572,10 +572,11 @@
"variable %r used in more than one block" % (v,))
vars[v] = only_in_link
- def usevar(v, in_link=None):
- assert v in vars
- if in_link is not None:
- assert vars[v] is None or vars[v] is in_link
+ def usevar(var, in_link=None):
+ for v in var.dependencies:
+ assert v in vars
+ if in_link is not None:
+ assert vars[v] is None or vars[v] is in_link
for block in graph.iterblocks():
@@ -593,10 +594,7 @@
for v in op.args:
assert isinstance(v, (Constant, Variable))
if isinstance(v, Variable):
- if type(v) is Variable:
- usevar(v)
- else:
- usevar(v.arg)
+ usevar(v)
else:
assert v.value is not last_exception
#assert v.value != last_exc_value
@@ -666,7 +664,7 @@
assert link.last_exc_value is None
for v in link.args:
assert isinstance(v, (Constant, Variable))
- if type(v) is Variable:
+ if isinstance(v, Variable):
usevar(v, in_link=link)
if exc_link:
assert v != block.operations[-1].result
More information about the pypy-commit
mailing list