lang: codegen: codegen_load_variable now supports loading non-ptr variables
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user