Couple of minor issues fixed

* CALLVALUE pushed incorrect value to the stack
* Set execution model to closure
This commit is contained in:
obscuren
2014-10-15 00:40:41 +02:00
parent 7ca7938d8e
commit 3d177be73e
6 changed files with 13 additions and 5 deletions

View File

@@ -482,7 +482,7 @@ func (self *DebugVm) RunClosure(closure *Closure) (ret []byte, err error) {
self.Printf(" => %x", caller)
case CALLVALUE:
value := self.env.Value()
value := closure.exe.value
stack.Push(value)
@@ -674,7 +674,10 @@ func (self *DebugVm) RunClosure(closure *Closure) (ret []byte, err error) {
val, loc := stack.Popn()
closure.SetStorage(loc, ethutil.NewValue(val))
closure.message.AddStorageChange(loc.Bytes())
// Debug sessions are allowed to run without message
if closure.message != nil {
closure.message.AddStorageChange(loc.Bytes())
}
self.Printf(" {0x%x : 0x%x}", loc.Bytes(), val.Bytes())
case JUMP: