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
858f17d2
Commit
858f17d2
authored
Jan 05, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change way of bulding the calltree
parent
1e5e4e8f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
19 deletions
+20
-19
traceCache.js
src/trace/traceCache.js
+20
-19
No files found.
src/trace/traceCache.js
View file @
858f17d2
...
@@ -7,9 +7,8 @@ TraceCache.prototype.init = function () {
...
@@ -7,9 +7,8 @@ TraceCache.prototype.init = function () {
// ...Changes contains index in the vmtrace of the corresponding changes
// ...Changes contains index in the vmtrace of the corresponding changes
this
.
returnValues
=
{}
this
.
returnValues
=
{}
this
.
callChanges
=
[]
this
.
currentCall
=
null
this
.
calls
=
{}
this
.
callsTree
=
null
this
.
callsRef
=
[]
// track of calls during the vm trace analysis
this
.
callsData
=
{}
this
.
callsData
=
{}
this
.
contractCreation
=
{}
this
.
contractCreation
=
{}
this
.
steps
=
{}
this
.
steps
=
{}
...
@@ -35,24 +34,26 @@ TraceCache.prototype.pushMemoryChanges = function (value) {
...
@@ -35,24 +34,26 @@ TraceCache.prototype.pushMemoryChanges = function (value) {
}
}
TraceCache
.
prototype
.
pushCall
=
function
(
step
,
index
,
address
,
callStack
,
outofGas
)
{
TraceCache
.
prototype
.
pushCall
=
function
(
step
,
index
,
address
,
callStack
,
outofGas
)
{
var
call
=
{
op
:
step
.
op
,
address
:
address
,
callStack
:
callStack
,
outofGas
:
outofGas
}
if
(
step
.
op
===
'RETURN'
||
step
.
op
===
'STOP'
||
outofGas
)
{
if
(
step
.
op
===
'RETURN'
||
step
.
op
===
'STOP'
||
outofGas
)
{
if
(
this
.
callsRef
.
length
>
1
)
{
// we are returning from an internal call
this
.
currentCall
.
call
.
return
=
index
this
.
callChanges
.
push
(
index
)
var
parent
=
this
.
currentCall
.
parent
this
.
calls
[
index
]
=
call
this
.
currentCall
=
{
call
:
parent
.
call
,
parent
:
parent
.
parent
}
var
callIndex
=
this
.
callsRef
.
pop
()
this
.
calls
[
index
].
call
=
callIndex
this
.
calls
[
callIndex
].
return
=
index
}
}
else
{
}
else
{
this
.
callChanges
.
push
(
index
)
var
call
=
{
this
.
calls
[
index
]
=
call
op
:
step
.
op
,
this
.
callsRef
.
push
(
index
)
address
:
address
,
callStack
:
callStack
,
outofGas
:
outofGas
,
calls
:
{},
start
:
index
}
this
.
addresses
.
push
(
address
)
if
(
this
.
currentCall
)
{
this
.
currentCall
.
call
.
calls
[
index
]
=
call
}
else
{
this
.
callsTree
=
{
call
:
call
}
}
this
.
currentCall
=
{
call
:
call
,
parent
:
this
.
currentCall
}
}
}
}
}
...
...
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