7123108: C1: assert(if_state != NULL) failed: states do not match up

In CEE, ensure if and common successor state are at the same inline level

Reviewed-by: never
This commit is contained in:
Roland Westrelin 2011-12-22 10:55:53 +01:00
parent 97439fb4ff
commit c10042bc68
2 changed files with 70 additions and 3 deletions

View file

@ -125,9 +125,16 @@ void CE_Eliminator::block_do(BlockBegin* block) {
// inlining depths must match
ValueStack* if_state = if_->state();
ValueStack* sux_state = sux->state();
while (sux_state->scope() != if_state->scope()) {
if_state = if_state->caller_state();
assert(if_state != NULL, "states do not match up");
if (if_state->scope()->level() > sux_state->scope()->level()) {
while (sux_state->scope() != if_state->scope()) {
if_state = if_state->caller_state();
assert(if_state != NULL, "states do not match up");
}
} else if (if_state->scope()->level() < sux_state->scope()->level()) {
while (sux_state->scope() != if_state->scope()) {
sux_state = sux_state->caller_state();
assert(sux_state != NULL, "states do not match up");
}
}
if (sux_state->stack_size() <= if_state->stack_size()) return;