- fixed: an 'if' that gets completely optimized away by a constant 'false' condition should not make the entire function disappear.
This commit is contained in:
parent
0cbdb9ab72
commit
58002f7f96
2 changed files with 20 additions and 0 deletions
|
|
@ -3648,6 +3648,7 @@ FxExpression *FxIfStatement::Resolve(FCompileContext &ctx)
|
|||
FxExpression *e = result ? WhenTrue : WhenFalse;
|
||||
delete (result ? WhenFalse : WhenTrue);
|
||||
WhenTrue = WhenFalse = NULL;
|
||||
if (e == NULL) e = new FxNop(ScriptPosition); // create a dummy if this statement gets completely removed by optimizing out the constant parts.
|
||||
delete this;
|
||||
return e;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue