mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +00:00
common: remove BigTrue
This commit is contained in:
parent
a894fe621e
commit
d3114f5e3b
2 changed files with 8 additions and 9 deletions
|
|
@ -20,14 +20,13 @@ import "math/big"
|
||||||
|
|
||||||
// Common big integers often used
|
// Common big integers often used
|
||||||
var (
|
var (
|
||||||
Big1 = big.NewInt(1)
|
Big1 = big.NewInt(1)
|
||||||
Big2 = big.NewInt(2)
|
Big2 = big.NewInt(2)
|
||||||
Big3 = big.NewInt(3)
|
Big3 = big.NewInt(3)
|
||||||
Big0 = big.NewInt(0)
|
Big0 = big.NewInt(0)
|
||||||
BigTrue = Big1
|
Big32 = big.NewInt(32)
|
||||||
Big32 = big.NewInt(32)
|
Big256 = big.NewInt(0xff)
|
||||||
Big256 = big.NewInt(0xff)
|
Big257 = big.NewInt(257)
|
||||||
Big257 = big.NewInt(257)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func String2Big(num string) *big.Int {
|
func String2Big(num string) *big.Int {
|
||||||
|
|
|
||||||
|
|
@ -505,7 +505,7 @@ func opJump(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Sta
|
||||||
}
|
}
|
||||||
func opJumpi(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) {
|
func opJumpi(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) {
|
||||||
pos, cond := stack.pop(), stack.pop()
|
pos, cond := stack.pop(), stack.pop()
|
||||||
if cond.Cmp(common.BigTrue) >= 0 {
|
if cond.BitLen() > 0 {
|
||||||
if !contract.jumpdests.has(contract.CodeHash, contract.Code, pos) {
|
if !contract.jumpdests.has(contract.CodeHash, contract.Code, pos) {
|
||||||
nop := contract.GetOp(pos.Uint64())
|
nop := contract.GetOp(pos.Uint64())
|
||||||
return nil, fmt.Errorf("invalid jump destination (%v) %v", nop, pos)
|
return nil, fmt.Errorf("invalid jump destination (%v) %v", nop, pos)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue