autofree: fix the tests
parent
06e4c45350
commit
613d6c043b
|
@ -1975,9 +1975,9 @@ fn (mut g Gen) autofree_var_call(free_fn_name string, v ast.Var) {
|
|||
// tmp expr vars do not need to be freed again here
|
||||
return
|
||||
}
|
||||
if v.is_autofree_tmp {
|
||||
return
|
||||
}
|
||||
// if v.is_autofree_tmp {
|
||||
// return
|
||||
// }
|
||||
if v.typ.is_ptr() {
|
||||
g.writeln('\t${free_fn_name}(${c_name(v.name)}); // autofreed ptr var')
|
||||
} else {
|
||||
|
|
|
@ -708,10 +708,10 @@ fn (mut g Gen) autofree_call_postgen(node_pos int) {
|
|||
return
|
||||
}
|
||||
*/
|
||||
// g.writeln('\n/* strs_to_free3: $g.nr_vars_to_free */')
|
||||
if g.nr_vars_to_free <= 0 {
|
||||
return
|
||||
}
|
||||
// g.writeln('\n/* strs_to_free3: */')
|
||||
/*
|
||||
for s in g.strs_to_free {
|
||||
g.writeln('string_free(&$s);')
|
||||
|
|
Loading…
Reference in New Issue