From 60a4f668b7f6933aaf63b2c91e8f0e4503bf0ea1 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Mon, 3 Feb 2020 11:13:36 +0100 Subject: [PATCH] v2: fix FnDecl ref bug --- vlib/v/gen/cgen.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/v/gen/cgen.v b/vlib/v/gen/cgen.v index 92ca8657d9..7180bd664f 100644 --- a/vlib/v/gen/cgen.v +++ b/vlib/v/gen/cgen.v @@ -24,7 +24,7 @@ pub fn cgen(files []ast.File, table &table.Table) string { definitions: strings.new_builder(100) table: table checker: checker.new_checker(table) // checker - + fn_decl: 0 } for file in files { @@ -59,7 +59,7 @@ fn (g mut Gen) stmt(node ast.Stmt) { } } ast.FnDecl { - g.fn_decl = &it + g.fn_decl = it // &it is_main := it.name == 'main' if is_main { g.write('int ${it.name}(')