mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
core/vm: address review concerns
This commit is contained in:
parent
f616a39b6a
commit
8f04ccdb8a
1 changed files with 3 additions and 5 deletions
|
|
@ -92,16 +92,14 @@ func (c *Contract) validJumpdest(dest *big.Int) bool {
|
||||||
if OpCode(c.Code[udest]) != JUMPDEST {
|
if OpCode(c.Code[udest]) != JUMPDEST {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
var analysis bitvec
|
|
||||||
// Do we have a contract hash already?
|
// Do we have a contract hash already?
|
||||||
if c.CodeHash != (common.Hash{}) {
|
if c.CodeHash != (common.Hash{}) {
|
||||||
var exist bool
|
|
||||||
// Does parent context have the analysis?
|
// Does parent context have the analysis?
|
||||||
analysis, exist = c.jumpdests[c.CodeHash]
|
analysis, exist := c.jumpdests[c.CodeHash]
|
||||||
if !exist {
|
if !exist {
|
||||||
// Do the analysis
|
// Do the analysis and save in parent context
|
||||||
|
// We do not need to store it in c.analysis
|
||||||
analysis = codeBitmap(c.Code)
|
analysis = codeBitmap(c.Code)
|
||||||
// Save in parent context
|
|
||||||
c.jumpdests[c.CodeHash] = analysis
|
c.jumpdests[c.CodeHash] = analysis
|
||||||
}
|
}
|
||||||
return analysis.codeSegment(udest)
|
return analysis.codeSegment(udest)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue