Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
33f2dfb3
Unverified
Commit
33f2dfb3
authored
Nov 26, 2018
by
yann300
Committed by
GitHub
Nov 26, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1050 from ethereum/checkRETURNandREVERT
Check RETURN and REVERT instruction ....
parents
0aea496a
f000b5db
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
traceHelper.js
remix-lib/src/helpers/traceHelper.js
+4
-0
traceAnalyser.js
remix-lib/src/trace/traceAnalyser.js
+4
-1
traceCache.js
remix-lib/src/trace/traceCache.js
+5
-0
No files found.
remix-lib/src/helpers/traceHelper.js
View file @
33f2dfb3
...
@@ -33,6 +33,10 @@ module.exports = {
...
@@ -33,6 +33,10 @@ module.exports = {
return
step
.
op
===
'STOP'
return
step
.
op
===
'STOP'
},
},
isRevertInstruction
:
function
(
step
)
{
return
step
.
op
===
'REVERT'
},
isSSTOREInstruction
:
function
(
step
)
{
isSSTOREInstruction
:
function
(
step
)
{
return
step
.
op
===
'SSTORE'
return
step
.
op
===
'SSTORE'
},
},
...
...
remix-lib/src/trace/traceAnalyser.js
View file @
33f2dfb3
...
@@ -82,9 +82,12 @@ TraceAnalyser.prototype.buildStorage = function (index, step, context) {
...
@@ -82,9 +82,12 @@ TraceAnalyser.prototype.buildStorage = function (index, step, context) {
this
.
traceCache
.
pushStoreChanges
(
index
+
1
,
context
.
storageContext
[
context
.
storageContext
.
length
-
1
])
this
.
traceCache
.
pushStoreChanges
(
index
+
1
,
context
.
storageContext
[
context
.
storageContext
.
length
-
1
])
}
else
if
(
traceHelper
.
isSSTOREInstruction
(
step
))
{
}
else
if
(
traceHelper
.
isSSTOREInstruction
(
step
))
{
this
.
traceCache
.
pushStoreChanges
(
index
+
1
,
context
.
storageContext
[
context
.
storageContext
.
length
-
1
],
step
.
stack
[
step
.
stack
.
length
-
1
],
step
.
stack
[
step
.
stack
.
length
-
2
])
this
.
traceCache
.
pushStoreChanges
(
index
+
1
,
context
.
storageContext
[
context
.
storageContext
.
length
-
1
],
step
.
stack
[
step
.
stack
.
length
-
1
],
step
.
stack
[
step
.
stack
.
length
-
2
])
}
else
if
(
traceHelper
.
isReturnInstruction
(
step
))
{
}
else
if
(
traceHelper
.
isReturnInstruction
(
step
)
||
traceHelper
.
isStopInstruction
(
step
)
)
{
context
.
storageContext
.
pop
()
context
.
storageContext
.
pop
()
this
.
traceCache
.
pushStoreChanges
(
index
+
1
,
context
.
storageContext
[
context
.
storageContext
.
length
-
1
])
this
.
traceCache
.
pushStoreChanges
(
index
+
1
,
context
.
storageContext
[
context
.
storageContext
.
length
-
1
])
}
else
if
(
traceHelper
.
isRevertInstruction
(
step
))
{
context
.
storageContext
.
pop
()
this
.
traceCache
.
resetStoreChanges
()
}
}
return
context
return
context
}
}
...
...
remix-lib/src/trace/traceCache.js
View file @
33f2dfb3
...
@@ -82,6 +82,11 @@ TraceCache.prototype.pushContractCreation = function (token, code) {
...
@@ -82,6 +82,11 @@ TraceCache.prototype.pushContractCreation = function (token, code) {
this
.
contractCreation
[
token
]
=
code
this
.
contractCreation
[
token
]
=
code
}
}
TraceCache
.
prototype
.
resetStoreChanges
=
function
(
index
,
address
,
key
,
value
)
{
this
.
sstore
=
{}
this
.
storageChanges
=
[]
}
TraceCache
.
prototype
.
pushStoreChanges
=
function
(
index
,
address
,
key
,
value
)
{
TraceCache
.
prototype
.
pushStoreChanges
=
function
(
index
,
address
,
key
,
value
)
{
this
.
sstore
[
index
]
=
{
this
.
sstore
[
index
]
=
{
'address'
:
address
,
'address'
:
address
,
...
...
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