fix autofree of heap variables
parent
d6c40865f9
commit
1877ca6d95
|
|
@ -2685,9 +2685,13 @@ fn (mut g Gen) autofree_var_call(free_fn_name string, v ast.Var) {
|
|||
if v.typ == ast.error_type && !v.is_autofree_tmp {
|
||||
return
|
||||
}
|
||||
if v.is_auto_heap {
|
||||
g.writeln('\t${free_fn_name}(${c_name(v.name)}); // autofreed heap var $g.cur_mod.name $g.is_builtin_mod')
|
||||
} else {
|
||||
g.writeln('\t${free_fn_name}(&${c_name(v.name)}); // autofreed var $g.cur_mod.name $g.is_builtin_mod')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn (mut g Gen) map_fn_ptrs(key_typ ast.TypeSymbol) (string, string, string, string) {
|
||||
mut hash_fn := ''
|
||||
|
|
|
|||
Loading…
Reference in New Issue