From 4571a5eb8343ed24f64365d633f542d2f950fb99 Mon Sep 17 00:00:00 2001 From: joe-conigliaro Date: Mon, 4 May 2020 20:08:37 +1000 Subject: [PATCH] gen: use middle of fn pos to load correct scope for free --- vlib/v/gen/fn.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlib/v/gen/fn.v b/vlib/v/gen/fn.v index 3e05e65164..d272294e04 100644 --- a/vlib/v/gen/fn.v +++ b/vlib/v/gen/fn.v @@ -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 {