mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
gen: use middle of fn pos to load correct scope for free
This commit is contained in:
parent
c112b3aec5
commit
4571a5eb83
@ -161,7 +161,7 @@ fn (mut g Gen) gen_fn_decl(it ast.FnDecl) {
|
||||
// ////////////
|
||||
if g.autofree {
|
||||
// println('\n\ncalling free for fn $it.name')
|
||||
g.free_scope_vars(it.pos.pos - 1)
|
||||
g.free_scope_vars(it.pos.pos + it.pos.len/2)
|
||||
}
|
||||
// /////////
|
||||
if is_main {
|
||||
|
Loading…
Reference in New Issue
Block a user