Skip to content

Commit 6f7723c

Browse files
committed
fix main return value issue, use int64 instead of int32
1 parent 6e099a1 commit 6f7723c

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

compiler/compiler/compiler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ func (c *Compiler) addGlobal() {
222222
b.NewRet(nil)
223223

224224
// main.main function, body will be added later
225-
c.mainFunc = c.module.NewFunc("main", types.I32.LLVM())
225+
c.mainFunc = c.module.NewFunc("main", types.I64.LLVM()) // TODO: Size based on arch
226226
mainBlock := c.mainFunc.NewBlock(name.Block())
227227
mainBlock.NewCall(c.initGlobalsFunc)
228228
}

tests/examples/always-true.cell

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
function main() {
2-
return true
2+
return 0
33
}

tests/examples/helloworld.cell

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ function main() {
77
ok = tx.ScriptVerify()
88
debug.Printf("hello world! %d\n", ok)
99
return 0
10-
}
10+
}

tests/examples/tx-script-verify.cell

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ function main() {
99

1010
// 1000
1111
debug.Printf("%d\n", ok)
12-
return true
13-
}
12+
return 0
13+
}

tests/examples/types.cell

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ function main() {
1414
r2 := v3 + v4
1515
debug.Printf(r2)
1616

17-
return true
17+
return 0
1818
}

0 commit comments

Comments
 (0)