ssa: fix slice type from *array

This commit is contained in:
visualfc
2024-05-29 12:34:06 +08:00
parent 4f21915f35
commit 2e49161415
4 changed files with 163 additions and 103 deletions

View File

@@ -250,7 +250,8 @@ func (b Builder) Slice(x, low, high, max Expr) (ret Expr) {
nCap = prog.IntVal(uint64(te.Len()), prog.Int())
if high.IsNil() {
if lowIsNil && max.IsNil() {
return b.unsafeSlice(x, nCap.impl, nCap.impl)
ret.impl = b.unsafeSlice(x, nCap.impl, nCap.impl).impl
return
}
high = nCap
}