Fix popping of lower priority expression term

This commit is contained in:
David Schmenk 2025-01-07 09:02:28 -08:00 committed by GitHub
parent 8776d9010b
commit c88c6affd7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -282,7 +282,7 @@ int parse_constexpr(long *value, int *size)
if (scantoken == binary_ops_table[i])
{
matchop = 2;
if (binary_ops_precedence[i] >= tos_op_prec(optos))
while (binary_ops_precedence[i] >= tos_op_prec(optos))
if (!calc_op(pop_op()))
parse_error("Invalid binary operation");
push_op(scantoken, binary_ops_precedence[i]);
@ -719,7 +719,7 @@ t_opseq *parse_expr(t_opseq *codeseq, int *stackdepth)
if (scantoken == binary_ops_table[i])
{
matchop = 2;
if (binary_ops_precedence[i] >= tos_op_prec(optos))
while (binary_ops_precedence[i] >= tos_op_prec(optos))
{
codeseq = gen_op(codeseq, pop_op());
if (stackdepth)