aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-06-23 17:26:51 +0800
committerobscuren <geffobscura@gmail.com>2014-06-23 17:26:51 +0800
commitd890258af6de8c5ef9701826fb4ee7c353788ad5 (patch)
treec0ae545b408ba64f3d9151dac712c7c1613104f2 /ethchain
parent803e4807ede157db36030c6415a4f515f723ccf0 (diff)
downloadgo-tangerine-d890258af6de8c5ef9701826fb4ee7c353788ad5.tar
go-tangerine-d890258af6de8c5ef9701826fb4ee7c353788ad5.tar.gz
go-tangerine-d890258af6de8c5ef9701826fb4ee7c353788ad5.tar.bz2
go-tangerine-d890258af6de8c5ef9701826fb4ee7c353788ad5.tar.lz
go-tangerine-d890258af6de8c5ef9701826fb4ee7c353788ad5.tar.xz
go-tangerine-d890258af6de8c5ef9701826fb4ee7c353788ad5.tar.zst
go-tangerine-d890258af6de8c5ef9701826fb4ee7c353788ad5.zip
Minor fixes to vm output
Diffstat (limited to 'ethchain')
-rw-r--r--ethchain/vm.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/ethchain/vm.go b/ethchain/vm.go
index bacd05ba5..a2e1c60fd 100644
--- a/ethchain/vm.go
+++ b/ethchain/vm.go
@@ -358,10 +358,10 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
case NOT:
require(1)
x := stack.Pop()
- if x.Cmp(ethutil.BigFalse) == 0 {
- stack.Push(ethutil.BigTrue)
- } else {
+ if x.Cmp(ethutil.BigFalse) > 0 {
stack.Push(ethutil.BigFalse)
+ } else {
+ stack.Push(ethutil.BigTrue)
}
// 0x10 range
@@ -542,16 +542,14 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
require(1)
loc := stack.Pop()
val := closure.GetMem(loc)
+
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:
require(2)
val, loc := stack.Popn()
-
- //if val.Cmp(big.NewInt(0)) != 0 {
closure.SetStorage(loc, ethutil.NewValue(val))
- //}
// Add the change to manifest
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
case STOP: // Stop the closure
- vm.Printf(" (g) %v", closure.Gas).Endl()
+ vm.Endl()
return closure.Return(nil), nil
default: