- fixed: Switch statement without a default jumped to the first first case label instead.

- removed placeholder code from scripted Marine.
This commit is contained in:
Christoph Oelckers 2016-11-21 22:20:25 +01:00
parent 135cfcf016
commit 3db712cd73
2 changed files with 7 additions and 9 deletions

View file

@ -8250,6 +8250,7 @@ ExpEmit FxSwitchStatement::Emit(VMFunctionBuilder *build)
}
size_t DefaultAddress = build->Emit(OP_JMP, 0);
TArray<size_t> BreakAddresses;
bool defaultset = false;
for (auto line : Content)
{
@ -8270,6 +8271,7 @@ ExpEmit FxSwitchStatement::Emit(VMFunctionBuilder *build)
else
{
build->BackpatchToHere(DefaultAddress);
defaultset = true;
}
break;
@ -8290,6 +8292,7 @@ ExpEmit FxSwitchStatement::Emit(VMFunctionBuilder *build)
{
build->BackpatchToHere(addr);
}
if (!defaultset) build->BackpatchToHere(DefaultAddress);
Content.Clear();
Content.ShrinkToFit();
return ExpEmit();