lang: codegen: disable CODEGEN_F_IGNORE_RESULT in expression generation

this flag caused some issues where the result of a message would
be ignored if it was the first operand in a larger expression.
This commit is contained in:
2025-04-18 23:15:28 +01:00
parent 78817b6b8c
commit 2ddb065243
2 changed files with 5 additions and 7 deletions

View File

@@ -139,13 +139,7 @@ static struct code_generator_result gen_msg(
debug_printf("codegen: got msg\n");
struct expr_codegen_state *expr = (struct expr_codegen_state *)state;
int flags = 0;
if (b_queue_empty(&expr->s_item_queue)
&& (expr->s_flags & CODEGEN_F_IGNORE_RESULT)) {
flags |= CODEGEN_F_IGNORE_RESULT;
}
codegen_push_generator(gen, CODE_GENERATOR_MSG, flags, NULL);
codegen_push_generator(gen, CODE_GENERATOR_MSG, 0, NULL);
return CODEGEN_RESULT_OK(CODEGEN_R_REPEAT_NODE);
}