Merge pull request #643 from visualfc/defernext

ssa: fix defer move block[0] index
This commit is contained in:
xushiwei
2024-08-09 12:54:46 +08:00
committed by GitHub
3 changed files with 12 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
package main
func main() {
syms := []int{}
for range syms {
}
defer println("bye")
for range syms {
}
}

View File

@@ -0,0 +1 @@
;

View File

@@ -86,6 +86,7 @@ const (
func (p Function) deferInitBuilder() (b Builder, next BasicBlock) {
b = p.NewBuilder()
next = b.setBlockMoveLast(p.blks[0])
p.blks[0].last = next.last
return
}