Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
8ead45c2
Unverified
Commit
8ead45c2
authored
Aug 04, 2020
by
Martin Holst Swende
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/vm: avoid map lookups for accessing jumpdest analysis
parent
82a9e110
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
contract.go
core/vm/contract.go
+6
-0
No files found.
core/vm/contract.go
View file @
8ead45c2
...
@@ -112,7 +112,13 @@ func (c *Contract) validJumpSubdest(udest uint64) bool {
...
@@ -112,7 +112,13 @@ func (c *Contract) validJumpSubdest(udest uint64) bool {
// isCode returns true if the provided PC location is an actual opcode, as
// isCode returns true if the provided PC location is an actual opcode, as
// opposed to a data-segment following a PUSHN operation.
// opposed to a data-segment following a PUSHN operation.
func
(
c
*
Contract
)
isCode
(
udest
uint64
)
bool
{
func
(
c
*
Contract
)
isCode
(
udest
uint64
)
bool
{
// Do we already have an analysis laying around?
if
c
.
analysis
!=
nil
{
return
c
.
analysis
.
codeSegment
(
udest
)
}
// Do we have a contract hash already?
// Do we have a contract hash already?
// If we do have a hash, that means it's a 'regular' contract. For regular
// contracts ( not temporary initcode), we store the analysis in a map
if
c
.
CodeHash
!=
(
common
.
Hash
{})
{
if
c
.
CodeHash
!=
(
common
.
Hash
{})
{
// Does parent context have the analysis?
// Does parent context have the analysis?
analysis
,
exist
:=
c
.
jumpdests
[
c
.
CodeHash
]
analysis
,
exist
:=
c
.
jumpdests
[
c
.
CodeHash
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment