Author: Ronan Lamy <[email protected]>
Branch: reflowing
Changeset: r88646:3c5e062cf847
Date: 2016-11-24 18:18 +0000
http://bitbucket.org/pypy/pypy/changeset/3c5e062cf847/
Log: Reinstate the annotation hack that was removed in db07794f9b14
diff --git a/rpython/annotator/bookkeeper.py b/rpython/annotator/bookkeeper.py
--- a/rpython/annotator/bookkeeper.py
+++ b/rpython/annotator/bookkeeper.py
@@ -510,7 +510,13 @@
results = []
for desc in pbc.descriptions:
results.append(desc.pycall(whence, args, v_result, op))
- s_result = unionof(*results)
+ # According to the fundamental annotation invariant, we should have
+ # unionof(*results).contains(v_result.annotation), but some
+ # specializers (e.g. argtype) don't respect that, so we make sure to
+ # return a generalisation of v_result.annotation.
+ s_result = v_result.annotation if v_result and v_result.annotation
else s_ImpossibleValue
+ for result in results:
+ s_result = unionof(s_result, result)
return s_result
def emulate_pbc_call(self, unique_key, pbc, args_s, replace=[],
callback=None):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit