mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-22 21:39:01 +00:00
interp: remove unused gepOperands slice
This commit is contained in:
@@ -590,18 +590,14 @@ func (r *runner) run(fn *function, params []value, parentMem *memoryView, indent
|
|||||||
// GetElementPtr does pointer arithmetic, changing the offset of the
|
// GetElementPtr does pointer arithmetic, changing the offset of the
|
||||||
// pointer into the underlying object.
|
// pointer into the underlying object.
|
||||||
var offset uint64
|
var offset uint64
|
||||||
var gepOperands []uint64
|
|
||||||
for i := 2; i < len(operands); i += 2 {
|
for i := 2; i < len(operands); i += 2 {
|
||||||
index := operands[i].Uint()
|
index := operands[i].Uint()
|
||||||
elementSize := operands[i+1].Uint()
|
elementSize := operands[i+1].Uint()
|
||||||
if int64(elementSize) < 0 {
|
if int64(elementSize) < 0 {
|
||||||
// This is a struct field.
|
// This is a struct field.
|
||||||
// The field number is encoded by flipping all the bits.
|
|
||||||
gepOperands = append(gepOperands, ^elementSize)
|
|
||||||
offset += index
|
offset += index
|
||||||
} else {
|
} else {
|
||||||
// This is a normal GEP, probably an array index.
|
// This is a normal GEP, probably an array index.
|
||||||
gepOperands = append(gepOperands, index)
|
|
||||||
offset += elementSize * index
|
offset += elementSize * index
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user