From 843d4832401ed96c333fc47501fb6764feec528e Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Wed, 3 Oct 2018 14:26:55 +0200 Subject: [PATCH] core/vm: removed type destinations --- core/vm/analysis.go | 8 -------- core/vm/contract.go | 6 +++--- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/core/vm/analysis.go b/core/vm/analysis.go index d0b367530c..0ccf47b979 100644 --- a/core/vm/analysis.go +++ b/core/vm/analysis.go @@ -16,14 +16,6 @@ package vm -import ( - "github.com/ethereum/go-ethereum/common" -) - -// destinations stores one bitmap per contract (keyed by hash of code). -// The bitmaps mark code and data-sections for a piece of contract code -type destinations map[common.Hash]bitvec - // bitvec is a bit vector which maps bytes in a program. // An unset bit means the byte is an opcode, a set bit means // it's data (i.e. argument of PUSHxx). diff --git a/core/vm/contract.go b/core/vm/contract.go index 5509e19410..4d2cd9df7a 100644 --- a/core/vm/contract.go +++ b/core/vm/contract.go @@ -49,8 +49,8 @@ type Contract struct { caller ContractRef self ContractRef - jumpdests destinations // Aggregated result of JUMPDEST analysis. - analysis bitvec // Locally cached result of JUMPDEST analysis + jumpdests map[common.Hash]bitvec // Aggregated result of JUMPDEST analysis. + analysis bitvec // Locally cached result of JUMPDEST analysis Code []byte CodeHash common.Hash @@ -69,7 +69,7 @@ func NewContract(caller ContractRef, object ContractRef, value *big.Int, gas uin // Reuse JUMPDEST analysis from parent context if available. c.jumpdests = parent.jumpdests } else { - c.jumpdests = make(destinations) + c.jumpdests = make(map[common.Hash]bitvec) } // Gas should be a pointer so it can safely be reduced through the run