From d2e5bb99ef277e64d58c6241db15b4cb285cd98e Mon Sep 17 00:00:00 2001 From: xushiwei Date: Fri, 24 May 2024 09:41:40 +0800 Subject: [PATCH] gentests; MakeBody fix --- chore/gentests/gentests.go | 1 + ssa/decl.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/chore/gentests/gentests.go b/chore/gentests/gentests.go index 2a8c2214..2eb83129 100644 --- a/chore/gentests/gentests.go +++ b/chore/gentests/gentests.go @@ -33,6 +33,7 @@ func main() { llgenDir(dir + "/cl/_testlibc") llgenDir(dir + "/cl/_testrt") + llgenDir(dir + "/cl/_testgo") llgenDir(dir+"/cl/_testpy", "") llgenDir(dir+"/cl/_testdata", "") } diff --git a/ssa/decl.go b/ssa/decl.go index a4b64db1..2ff49cde 100644 --- a/ssa/decl.go +++ b/ssa/decl.go @@ -287,7 +287,8 @@ func (p Function) HasBody() bool { func (p Function) MakeBody(nblk int) Builder { p.MakeBlocks(nblk) b := p.NewBuilder() - b.impl.SetInsertPointAtEnd(p.blks[0].last) + b.blk = p.blks[0] + b.impl.SetInsertPointAtEnd(b.blk.last) return b }