autofree: do not run in `builtin`
parent
b14f779853
commit
212e6fe52c
|
@ -1909,6 +1909,10 @@ fn (mut g Gen) gen_clone_assignment(val ast.Expr, right_sym table.TypeSymbol, ad
|
|||
}
|
||||
|
||||
fn (mut g Gen) autofree_scope_vars(pos int) {
|
||||
if g.is_builtin_mod {
|
||||
// In `builtin` everything is freed manually.
|
||||
return
|
||||
}
|
||||
g.writeln('// autofree_scope_vars($pos)')
|
||||
// eprintln('> free_scope_vars($pos)')
|
||||
scope := g.file.scope.innermost(pos)
|
||||
|
@ -1982,6 +1986,10 @@ fn (mut g Gen) autofree_var_call(free_fn_name string, v ast.Var) {
|
|||
if v.is_autofree_tmp && !g.doing_autofree_tmp {
|
||||
return
|
||||
}
|
||||
if v.name.contains('expr_write_1_') {
|
||||
// TODO remove this temporary hack
|
||||
return
|
||||
}
|
||||
if v.typ.is_ptr() {
|
||||
g.writeln('\t${free_fn_name}(${c_name(v.name)}); // autofreed ptr var')
|
||||
} else {
|
||||
|
|
|
@ -224,8 +224,8 @@ fn main() {
|
|||
str_replace2()
|
||||
if_cond()
|
||||
addition_with_tmp_expr()
|
||||
if_expr()
|
||||
return_if_expr()
|
||||
q := if_expr()
|
||||
s := return_if_expr()
|
||||
free_inside_opt_block()
|
||||
// free_map()
|
||||
// loop_map()
|
||||
|
|
Loading…
Reference in New Issue