gen-zam: fix for generating relational operations with first operand being a constant

This commit is contained in:
Vern Paxson 2024-04-19 19:17:52 -07:00 committed by Tim Wojtulewicz
parent f9385ef88d
commit aee70af743

View file

@ -1683,8 +1683,13 @@ void ZAM_RelationalExprOpTemplate::BuildInstruction(const vector<ZAM_OperandType
else
op1 = "n1";
}
else
{
if ( ot[1] == ZAM_OT_CONSTANT )
op1 = "c";
else
op1 = "n2";
}
auto type_suffix = zc == ZIC_VEC ? "->Yield();" : ";";
Emit("auto t = " + op1 + "->GetType()" + type_suffix);