diff options
Diffstat (limited to 'core/vm/sqlvm/runtime/runtime.go')
-rw-r--r-- | core/vm/sqlvm/runtime/runtime.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/core/vm/sqlvm/runtime/runtime.go b/core/vm/sqlvm/runtime/runtime.go index 8c3a105ac..e6a3a0006 100644 --- a/core/vm/sqlvm/runtime/runtime.go +++ b/core/vm/sqlvm/runtime/runtime.go @@ -3,20 +3,25 @@ package runtime import ( "github.com/dexon-foundation/dexon/core/vm" "github.com/dexon-foundation/dexon/core/vm/sqlvm/common" - "github.com/dexon-foundation/dexon/core/vm/sqlvm/errors" + se "github.com/dexon-foundation/dexon/core/vm/sqlvm/errors" ) // Run is runtime entrypoint. func Run(stateDB vm.StateDB, ins []Instruction, registers []*Operand) (ret []byte, err error) { for _, in := range ins { + for i := 0; i < len(in.Input); i++ { + if !in.Input[i].IsImmediate { + in.Input[i] = registers[in.Input[i].RegisterIndex] + } + } opFunc := jumpTable[in.Op] loadRegister(in.Input, registers) errCode := opFunc(&common.Context{}, in.Input, registers, in.Output) if errCode != nil { - err = errors.Error{ + err = se.Error{ Position: in.Position, - Code: errCode.(errors.ErrorCode), - Category: errors.ErrorCategoryRuntime, + Code: errCode.(se.ErrorCode), + Category: se.ErrorCategoryRuntime, } return nil, err } |