diff options
author | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-08-11 06:16:38 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-08-11 06:16:38 +0800 |
commit | 32395ddb891f3a32bc1295296a0887ed9479eeb0 (patch) | |
tree | bc1742819b8d68ecdce8cdf4f16b16d362074cdd /core/vm/instructions.go | |
parent | 2fcf7f1241648dc2c0ed90a122c5945f25b3ce1a (diff) | |
download | go-tangerine-32395ddb891f3a32bc1295296a0887ed9479eeb0.tar.gz go-tangerine-32395ddb891f3a32bc1295296a0887ed9479eeb0.tar.zst go-tangerine-32395ddb891f3a32bc1295296a0887ed9479eeb0.zip |
core/vm: fixed jit error & added inline docs
opNumber did not create a new big int which could lead to the block's
number being modified.
Diffstat (limited to 'core/vm/instructions.go')
-rw-r--r-- | core/vm/instructions.go | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/core/vm/instructions.go b/core/vm/instructions.go index 6b7b41220..2de35a443 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -341,19 +341,19 @@ func opCoinbase(instr instruction, env Environment, context *Context, memory *Me } func opTimestamp(instr instruction, env Environment, context *Context, memory *Memory, stack *stack) { - stack.push(new(big.Int).SetUint64(env.Time())) + stack.push(U256(new(big.Int).SetUint64(env.Time()))) } func opNumber(instr instruction, env Environment, context *Context, memory *Memory, stack *stack) { - stack.push(U256(env.BlockNumber())) + stack.push(U256(new(big.Int).Set(env.BlockNumber()))) } func opDifficulty(instr instruction, env Environment, context *Context, memory *Memory, stack *stack) { - stack.push(new(big.Int).Set(env.Difficulty())) + stack.push(U256(new(big.Int).Set(env.Difficulty()))) } func opGasLimit(instr instruction, env Environment, context *Context, memory *Memory, stack *stack) { - stack.push(new(big.Int).Set(env.GasLimit())) + stack.push(U256(new(big.Int).Set(env.GasLimit()))) } func opPop(instr instruction, env Environment, context *Context, memory *Memory, stack *stack) { @@ -415,15 +415,12 @@ func opSstore(instr instruction, env Environment, context *Context, memory *Memo env.State().SetState(context.Address(), loc, common.BigToHash(val)) } -func opJump(instr instruction, env Environment, context *Context, memory *Memory, stack *stack) { -} -func opJumpi(instr instruction, env Environment, context *Context, memory *Memory, stack *stack) { -} -func opJumpdest(instr instruction, env Environment, context *Context, memory *Memory, stack *stack) { -} +func opJump(instr instruction, env Environment, context *Context, memory *Memory, stack *stack) {} +func opJumpi(instr instruction, env Environment, context *Context, memory *Memory, stack *stack) {} +func opJumpdest(instr instruction, env Environment, context *Context, memory *Memory, stack *stack) {} func opPc(instr instruction, env Environment, context *Context, memory *Memory, stack *stack) { - stack.push(instr.data) + stack.push(new(big.Int).Set(instr.data)) } func opMsize(instr instruction, env Environment, context *Context, memory *Memory, stack *stack) { |