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:
@@ -139,13 +139,7 @@ static struct code_generator_result gen_msg(
|
|||||||
debug_printf("codegen: got msg\n");
|
debug_printf("codegen: got msg\n");
|
||||||
struct expr_codegen_state *expr = (struct expr_codegen_state *)state;
|
struct expr_codegen_state *expr = (struct expr_codegen_state *)state;
|
||||||
|
|
||||||
int flags = 0;
|
codegen_push_generator(gen, CODE_GENERATOR_MSG, 0, NULL);
|
||||||
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);
|
|
||||||
|
|
||||||
return CODEGEN_RESULT_OK(CODEGEN_R_REPEAT_NODE);
|
return CODEGEN_RESULT_OK(CODEGEN_R_REPEAT_NODE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,6 +149,7 @@ static enum ivy_status state_fini(
|
|||||||
struct mie_type *ret_type = NULL;
|
struct mie_type *ret_type = NULL;
|
||||||
const char *value_name = NULL;
|
const char *value_name = NULL;
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (msg->s_flags & CODEGEN_F_IGNORE_RESULT) {
|
if (msg->s_flags & CODEGEN_F_IGNORE_RESULT) {
|
||||||
ret_type = mie_ctx_get_type(gen->c_ctx, MIE_TYPE_VOID);
|
ret_type = mie_ctx_get_type(gen->c_ctx, MIE_TYPE_VOID);
|
||||||
flags = MIE_BUILDER_IGNORE_RESULT;
|
flags = MIE_BUILDER_IGNORE_RESULT;
|
||||||
@@ -156,6 +157,9 @@ static enum ivy_status state_fini(
|
|||||||
ret_type = mie_ctx_get_type(gen->c_ctx, MIE_TYPE_ID);
|
ret_type = mie_ctx_get_type(gen->c_ctx, MIE_TYPE_ID);
|
||||||
value_name = "msgtmp";
|
value_name = "msgtmp";
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
ret_type = mie_ctx_get_type(gen->c_ctx, MIE_TYPE_ID);
|
||||||
|
value_name = "msgtmp";
|
||||||
|
|
||||||
struct mie_value *msg_send = mie_builder_msg(
|
struct mie_value *msg_send = mie_builder_msg(
|
||||||
gen->c_builder, ret_type, msg->s_recipient, sel_value,
|
gen->c_builder, ret_type, msg->s_recipient, sel_value,
|
||||||
|
|||||||
Reference in New Issue
Block a user