ssa: fix defer move block[0] index

This commit is contained in:
visualfc
2024-08-02 11:54:43 +08:00
parent 34e454c054
commit 6ca63d4c68
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
}