- added a missing null pointer check to FxIfStatement::Emit.

This commit is contained in:
Christoph Oelckers 2016-12-18 12:18:03 +01:00
parent 1bcebb091a
commit 8dd91f7129

View file

@ -8964,7 +8964,7 @@ ExpEmit FxIfStatement::Emit(VMFunctionBuilder *build)
} }
if (WhenFalse != nullptr) if (WhenFalse != nullptr)
{ {
if (!WhenTrue->CheckReturn()) jumpspot = build->Emit(OP_JMP, 0); // no need to emit a jump if the block returns. if (WhenTrue != nullptr && !WhenTrue->CheckReturn()) jumpspot = build->Emit(OP_JMP, 0); // no need to emit a jump if the block returns.
build->BackpatchListToHere(no); build->BackpatchListToHere(no);
WhenFalse->EmitStatement(build); WhenFalse->EmitStatement(build);
if (jumpspot != ~0u) build->BackpatchToHere(jumpspot); if (jumpspot != ~0u) build->BackpatchToHere(jumpspot);