Another fix for early width and sign detection in ast simplifier

This commit is contained in:
Clifford Wolf 2013-11-04 21:29:36 +01:00
parent 31ddf7b9d4
commit f2786df146
1 changed files with 3 additions and 2 deletions

View File

@ -191,8 +191,9 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
case AST_ASSIGN:
while (children[0]->simplify(false, false, true, stage, -1, false) == true) { }
while (children[1]->simplify(false, false, false, stage, -1, false) == true) { }
children[0]->detectSignWidth(width_hint, backup_sign_hint);
children[1]->detectSignWidth(backup_width_hint, sign_hint);
children[0]->detectSignWidth(backup_width_hint, backup_sign_hint);
children[1]->detectSignWidth(width_hint, sign_hint);
width_hint = std::max(width_hint, backup_width_hint);
child_0_is_self_determined = true;
break;