Merge remote-tracking branch 'gop/main' into q

This commit is contained in:
xushiwei
2024-05-30 16:28:43 +08:00
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
}