ssa: fix slice high
This commit is contained in:
@@ -333,6 +333,7 @@ func (b Builder) Slice(x, low, high, max Expr) (ret Expr) {
|
||||
if debugInstr {
|
||||
log.Printf("Slice %v, %v, %v\n", x.impl, low.impl, high.impl)
|
||||
}
|
||||
|
||||
prog := b.Prog
|
||||
var nCap Expr
|
||||
var nEltSize Expr
|
||||
@@ -356,7 +357,7 @@ func (b Builder) Slice(x, low, high, max Expr) (ret Expr) {
|
||||
nEltSize = SizeOf(prog, prog.Index(x.Type))
|
||||
nCap = b.SliceCap(x)
|
||||
if high.IsNil() {
|
||||
high = b.SliceCap(x)
|
||||
high = b.SliceLen(x)
|
||||
}
|
||||
ret.Type = x.Type
|
||||
base = b.SliceData(x)
|
||||
|
||||
Reference in New Issue
Block a user