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

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