mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-04-07 02:22:58 +00:00
Fix FxExpression::EmitCompare not properly handling constant registers.
This commit is contained in:
parent
e01297803a
commit
7d180069e3
1 changed files with 24 additions and 0 deletions
|
@ -387,6 +387,30 @@ void FxExpression::EmitCompare(VMFunctionBuilder *build, bool invert, TArray<siz
|
|||
if (op.Konst)
|
||||
{
|
||||
ScriptPosition.Message(MSG_WARNING, "Conditional expression is constant");
|
||||
ExpEmit temp(build, op.RegType);
|
||||
switch (op.RegType)
|
||||
{
|
||||
case REGT_INT:
|
||||
build->Emit(OP_LK, temp.RegNum, op.RegNum);
|
||||
break;
|
||||
|
||||
case REGT_FLOAT:
|
||||
build->Emit(OP_LKF, temp.RegNum, op.RegNum);
|
||||
break;
|
||||
|
||||
case REGT_POINTER:
|
||||
build->Emit(OP_LKP, temp.RegNum, op.RegNum);
|
||||
break;
|
||||
|
||||
case REGT_STRING:
|
||||
build->Emit(OP_LKS, temp.RegNum, op.RegNum);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
op.Free(build);
|
||||
op = temp;
|
||||
}
|
||||
switch (op.RegType)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue