lang: codegen: codegen_load_variable now supports loading non-ptr variables

This commit is contained in:
2025-04-23 11:00:16 +01:00
parent 3af786b32c
commit 857d99ea34

View File

@@ -220,7 +220,12 @@ enum ivy_status codegen_resolve_variable(
struct mie_value *codegen_load_variable(
struct ivy_codegen *gen, struct codegen_var *var)
{
return mie_builder_load(gen->c_builder, var->v_type, var->v_value, NULL);
if (var->v_flags & CODEGEN_VAR_F_PTR) {
return mie_builder_load(
gen->c_builder, var->v_type, var->v_value, NULL);
}
return var->v_value;
}
static struct code_generator_state *get_current_generator_state(