good morning!!!!

Skip to content
Snippets Groups Projects
Commit 0de9b16b authored by Jeffrey Wilcke's avatar Jeffrey Wilcke
Browse files

Merge pull request #1896 from karalabe/fix-vm-stack-logs

core/vm: copy stack element to prevent overwrites
parents 315a422b af9afb68
No related branches found
No related tags found
No related merge requests found
...@@ -370,9 +370,11 @@ func (self *Vm) log(pc uint64, op OpCode, gas, cost *big.Int, memory *Memory, st ...@@ -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 ...@@ -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})
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment