mirror of
https://github.com/GayPizzaSpecifications/pork.git
synced 2025-08-02 12:50:55 +00:00
fix a small bug with return values
This commit is contained in:
parent
3dcac2f9e6
commit
d0e2f2a05e
@ -18,6 +18,7 @@ class IrStubOpEmitter(val irDefinition: IrDefinition, val code: CodeBuilder) : I
|
||||
|
||||
fun final() {
|
||||
if (code.lastOp()?.op?.code != Opcode.Return) {
|
||||
code.emit(Opcode.None)
|
||||
code.emit(Opcode.Return)
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,9 @@
|
||||
func depth(i: int32) {
|
||||
if i <= 0 {
|
||||
return None
|
||||
}
|
||||
println("Depth: ", i)
|
||||
depth(i - 1)
|
||||
}
|
||||
|
||||
export func main() {
|
||||
@ -11,5 +15,19 @@ export func main() {
|
||||
true
|
||||
}
|
||||
|
||||
return println("uhm, bad")
|
||||
if true {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
if false {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
depth(500)
|
||||
|
||||
println("uhm, bad")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user