fix for '?' operator precedence when compiling scripts to C++

This commit is contained in:
Vern Paxson 2025-09-15 14:18:16 -07:00
parent b25a844210
commit 6a9175da7d

View file

@ -260,7 +260,7 @@ string CPPCompile::GenCondExpr(const Expr* e, GenType gt) {
if ( op1->GetType()->Tag() == TYPE_VECTOR )
return string("vector_select__CPP(") + gen1 + ", " + gen2 + ", " + gen3 + ")";
return string("(") + gen1 + ") ? (" + gen2 + ") : (" + gen3 + ")";
return string("((") + gen1 + ") ? (" + gen2 + ") : (" + gen3 + "))";
}
string CPPCompile::GenCallExpr(const CallExpr* c, GenType gt, bool top_level) {