mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v2: fix FnDecl ref bug
This commit is contained in:
parent
2af3c0ede4
commit
60a4f668b7
@ -24,7 +24,7 @@ pub fn cgen(files []ast.File, table &table.Table) string {
|
|||||||
definitions: strings.new_builder(100)
|
definitions: strings.new_builder(100)
|
||||||
table: table
|
table: table
|
||||||
checker: checker.new_checker(table) // checker
|
checker: checker.new_checker(table) // checker
|
||||||
|
|
||||||
fn_decl: 0
|
fn_decl: 0
|
||||||
}
|
}
|
||||||
for file in files {
|
for file in files {
|
||||||
@ -59,7 +59,7 @@ fn (g mut Gen) stmt(node ast.Stmt) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ast.FnDecl {
|
ast.FnDecl {
|
||||||
g.fn_decl = &it
|
g.fn_decl = it // &it
|
||||||
is_main := it.name == 'main'
|
is_main := it.name == 'main'
|
||||||
if is_main {
|
if is_main {
|
||||||
g.write('int ${it.name}(')
|
g.write('int ${it.name}(')
|
||||||
|
Loading…
Reference in New Issue
Block a user