gen: use middle of fn pos to load correct scope for free

pull/4699/head
joe-conigliaro 2020-05-04 20:08:37 +10:00
parent c112b3aec5
commit 4571a5eb83
No known key found for this signature in database
GPG Key ID: C12F7136C08206F1
1 changed files with 1 additions and 1 deletions

View File

@ -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 {