diff options
author | Felix Lange <fjl@users.noreply.github.com> | 2017-08-24 19:09:53 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-24 19:09:53 +0800 |
commit | 54b1de67e2cbe700a4086d33b10501578dbeaaaf (patch) | |
tree | 7cab37659857b0db47fb05f961494209055a73ee | |
parent | 967e097faa51850a01053624cc74f300edf9770b (diff) | |
download | dexon-54b1de67e2cbe700a4086d33b10501578dbeaaaf.tar dexon-54b1de67e2cbe700a4086d33b10501578dbeaaaf.tar.gz dexon-54b1de67e2cbe700a4086d33b10501578dbeaaaf.tar.bz2 dexon-54b1de67e2cbe700a4086d33b10501578dbeaaaf.tar.lz dexon-54b1de67e2cbe700a4086d33b10501578dbeaaaf.tar.xz dexon-54b1de67e2cbe700a4086d33b10501578dbeaaaf.tar.zst dexon-54b1de67e2cbe700a4086d33b10501578dbeaaaf.zip |
core/vm: make jumpdest code nicer
-rw-r--r-- | core/vm/analysis.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/core/vm/analysis.go b/core/vm/analysis.go index 3ff862695..08415fc1e 100644 --- a/core/vm/analysis.go +++ b/core/vm/analysis.go @@ -42,7 +42,6 @@ func (d destinations) has(codehash common.Hash, code []byte, dest *big.Int) bool d[codehash] = m } return OpCode(code[udest]) == JUMPDEST && m.codeSegment(udest) - // return (m[udest/8] & (1 << (udest % 8))) != 0 } // bitvec is a bit vector which maps bytes in a program @@ -68,8 +67,7 @@ func jumpdests(code []byte) []byte { //The map is 4 bytes longer than necessary, in case the code // ends with a PUSH32, the algorithm will push zeroes onto the // bitvector outside the bounds of the actual code. - m := make([]byte, len(code)/8+1+4) - bits := bitvec(m) + bits := make(bitvec, len(code)/8+1+4) for pc := uint64(0); pc < uint64(len(code)); { op := OpCode(code[pc]) |