Commit ae2b1c0c authored by Kevin Modzelewski's avatar Kevin Modzelewski

Regression test: this test throws an irgen assertion

This issue is that type analysis is stronger than irgen.
Specifically here, type analysis knows that the phi isn't required
and propagates the type across BB's, but irgen conservatively promotes
to UNKNOWN.
parent 33ac174e
......@@ -2667,16 +2667,15 @@ private:
ConcreteCompilerVariable* v = p.second->makeConverted(emitter, phi_type);
symbol_table[p.first] = v;
} else {
#ifndef NDEBUG
if (myblock->successors.size()) {
// TODO getTypeAtBlockEnd will automatically convert up to the concrete type, which we don't
// want
// here, but this is just for debugging so I guess let it happen for now:
ConcreteCompilerType* ending_type = types->getTypeAtBlockEnd(p.first, myblock);
ASSERT(p.second->canConvertTo(ending_type), "%s is supposed to be %s, but somehow is %s",
p.first.c_str(), ending_type->debugName().c_str(), p.second->getType()->debugName().c_str());
RELEASE_ASSERT(p.second->canConvertTo(ending_type), "%s is supposed to be %s, but somehow is %s",
p.first.c_str(), ending_type->debugName().c_str(),
p.second->getType()->debugName().c_str());
}
#endif
}
}
......
# fail-if: '-n' not in EXTRA_JIT_ARGS and '-O' not in EXTRA_JIT_ARGS
# - This test needs type profiling to be enabled to trigger the bug
# This test throws an irgen assertion.
# The issue is that type analysis is stronger than phi analysis and
# they produce slightly different results.
import thread
l = thread.allocate_lock()
class L(object):
def __enter__(self):
return self
def __exit__(self, *args):
pass
L = thread.allocate_lock
class C(object):
def __init__(self):
self.lock = L()
def f(self):
try:
with self.lock:
for i in []:
pass
finally:
pass
c = C()
for i in xrange(10000):
c.f()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment