Minor fixes to vm output

This commit is contained in:
obscuren 2014-06-23 11:26:51 +02:00
parent 803e4807ed
commit d890258af6

View File

@ -358,10 +358,10 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
case NOT: case NOT:
require(1) require(1)
x := stack.Pop() x := stack.Pop()
if x.Cmp(ethutil.BigFalse) == 0 { if x.Cmp(ethutil.BigFalse) > 0 {
stack.Push(ethutil.BigTrue)
} else {
stack.Push(ethutil.BigFalse) stack.Push(ethutil.BigFalse)
} else {
stack.Push(ethutil.BigTrue)
} }
// 0x10 range // 0x10 range
@ -542,16 +542,14 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
require(1) require(1)
loc := stack.Pop() loc := stack.Pop()
val := closure.GetMem(loc) val := closure.GetMem(loc)
stack.Push(val.BigInt()) stack.Push(val.BigInt())
vm.Printf(" {0x%x} 0x%x", loc.Bytes(), val) vm.Printf(" {0x%x} 0x%x", loc.Bytes(), val.Bytes())
case SSTORE: case SSTORE:
require(2) require(2)
val, loc := stack.Popn() val, loc := stack.Popn()
//if val.Cmp(big.NewInt(0)) != 0 {
closure.SetStorage(loc, ethutil.NewValue(val)) closure.SetStorage(loc, ethutil.NewValue(val))
//}
// Add the change to manifest // Add the change to manifest
vm.state.manifest.AddStorageChange(closure.Object(), loc.Bytes(), val) vm.state.manifest.AddStorageChange(closure.Object(), loc.Bytes(), val)
@ -690,7 +688,7 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
fallthrough fallthrough
case STOP: // Stop the closure case STOP: // Stop the closure
vm.Printf(" (g) %v", closure.Gas).Endl() vm.Endl()
return closure.Return(nil), nil return closure.Return(nil), nil
default: default: