mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-25 21:07:17 +00:00
core/vm: copy stack element to prevent overwrites
This commit is contained in:
parent
315a422ba7
commit
af9afb686b
@ -370,9 +370,11 @@ func (self *Vm) log(pc uint64, op OpCode, gas, cost *big.Int, memory *Memory, st
|
|||||||
if Debug {
|
if Debug {
|
||||||
mem := make([]byte, len(memory.Data()))
|
mem := make([]byte, len(memory.Data()))
|
||||||
copy(mem, memory.Data())
|
copy(mem, memory.Data())
|
||||||
stck := make([]*big.Int, len(stack.Data()))
|
|
||||||
copy(stck, stack.Data())
|
|
||||||
|
|
||||||
|
stck := make([]*big.Int, len(stack.Data()))
|
||||||
|
for i, item := range stack.Data() {
|
||||||
|
stck[i] = new(big.Int).Set(item)
|
||||||
|
}
|
||||||
storage := make(map[common.Hash][]byte)
|
storage := make(map[common.Hash][]byte)
|
||||||
/*
|
/*
|
||||||
object := contract.self.(*state.StateObject)
|
object := contract.self.(*state.StateObject)
|
||||||
@ -380,7 +382,6 @@ func (self *Vm) log(pc uint64, op OpCode, gas, cost *big.Int, memory *Memory, st
|
|||||||
storage[common.BytesToHash(k)] = v
|
storage[common.BytesToHash(k)] = v
|
||||||
})
|
})
|
||||||
*/
|
*/
|
||||||
|
|
||||||
self.env.AddStructLog(StructLog{pc, op, new(big.Int).Set(gas), cost, mem, stck, storage, err})
|
self.env.AddStructLog(StructLog{pc, op, new(big.Int).Set(gas), cost, mem, stck, storage, err})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user