llgo/ssa: getDefer fix

This commit is contained in:
xushiwei
2024-06-08 20:09:56 +08:00
parent 32bfb3d57e
commit 63c03bb28c
7 changed files with 49 additions and 11 deletions

View File

@@ -0,0 +1,16 @@
package foo
func f(s string) bool {
return len(s) > 2
}
func Loop() {
for i := 0; i < 3; i++ {
if s := "hello"; f(s) {
defer println(s)
} else {
defer println("world")
return
}
}
}