fix crash in BranchEvent::compile for bootimage builds

We can't reduce a conditional branch to an unconditional jump unless
both arguments to the comparison are constants *and* those constants
have been resolved.  The latter may not be true in the case of a
bootimage build.
This commit is contained in:
Joel Dice 2011-07-16 19:10:05 -06:00
parent a2933c1f9e
commit 67cbc79613

View File

@ -4815,7 +4815,11 @@ class BranchEvent: public Event {
ConstantSite* secondConstant = findConstantSite(c, second);
if (not unreachable(this)) {
if (firstConstant and secondConstant) {
if (firstConstant
and secondConstant
and firstConstant->value->resolved()
and secondConstant->value->resolved())
{
int64_t firstValue = firstConstant->value->value();
int64_t secondValue = secondConstant->value->value();