mirror of
https://github.com/GayPizzaSpecifications/pork.git
synced 2025-08-02 21:00:56 +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() {
|
fun final() {
|
||||||
if (code.lastOp()?.op?.code != Opcode.Return) {
|
if (code.lastOp()?.op?.code != Opcode.Return) {
|
||||||
|
code.emit(Opcode.None)
|
||||||
code.emit(Opcode.Return)
|
code.emit(Opcode.Return)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
func depth(i: int32) {
|
func depth(i: int32) {
|
||||||
|
if i <= 0 {
|
||||||
|
return None
|
||||||
|
}
|
||||||
println("Depth: ", i)
|
println("Depth: ", i)
|
||||||
|
depth(i - 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
export func main() {
|
export func main() {
|
||||||
@ -11,5 +15,19 @@ export func main() {
|
|||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
return println("uhm, bad")
|
if true {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if false {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
depth(500)
|
||||||
|
|
||||||
|
println("uhm, bad")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user