mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
autofree: fix stmts() free
This commit is contained in:
parent
1338e7fce2
commit
7231b467a6
@ -623,8 +623,11 @@ fn (mut g Gen) stmts(stmts []ast.Stmt) {
|
|||||||
g.write(')')
|
g.write(')')
|
||||||
}
|
}
|
||||||
if g.pref.autofree && stmts.len > 0 {
|
if g.pref.autofree && stmts.len > 0 {
|
||||||
|
stmt := stmts[stmts.len - 1]
|
||||||
|
if stmt !is ast.FnDecl {
|
||||||
// g.writeln('// autofree scope')
|
// g.writeln('// autofree scope')
|
||||||
g.autofree_scope_vars(stmts[stmts.len - 1].position().pos)
|
g.autofree_scope_vars(stmt.position().pos)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user