mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-25 21:41:03 +00:00
- reorder evaluation for 'if' statements to handle the condition first.
Otherwise this won't emit errors if a bad condition is used with an empty conditional part.
This commit is contained in:
parent
55520ed7d0
commit
03b7324f71
1 changed files with 2 additions and 2 deletions
|
@ -9823,6 +9823,8 @@ FxExpression *FxIfStatement::Resolve(FCompileContext &ctx)
|
|||
{
|
||||
CHECKRESOLVED();
|
||||
|
||||
SAFE_RESOLVE(Condition, ctx);
|
||||
|
||||
if (WhenTrue == nullptr && WhenFalse == nullptr)
|
||||
{ // We don't do anything either way, so disappear
|
||||
delete this;
|
||||
|
@ -9830,8 +9832,6 @@ FxExpression *FxIfStatement::Resolve(FCompileContext &ctx)
|
|||
return new FxNop(ScriptPosition);
|
||||
}
|
||||
|
||||
SAFE_RESOLVE(Condition, ctx);
|
||||
|
||||
if (Condition->ValueType != TypeBool)
|
||||
{
|
||||
Condition = new FxBoolCast(Condition, false);
|
||||
|
|
Loading…
Reference in a new issue