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
c316d0b1
Commit
c316d0b1
authored
Aug 30, 2017
by
yann300
Committed by
GitHub
Aug 30, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #562 from ethereum/fixLocalVars
Fix return of external call vs return of internal call
parents
accd1a8b
676cdc1a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
internalCallTree.js
src/util/internalCallTree.js
+6
-6
No files found.
src/util/internalCallTree.js
View file @
c316d0b1
...
@@ -32,7 +32,7 @@ class InternalCallTree {
...
@@ -32,7 +32,7 @@ class InternalCallTree {
if
(
!
this
.
solidityProxy
.
loaded
())
{
if
(
!
this
.
solidityProxy
.
loaded
())
{
this
.
event
.
trigger
(
'callTreeBuildFailed'
,
[
'compilation result not loaded. Cannot build internal call tree'
])
this
.
event
.
trigger
(
'callTreeBuildFailed'
,
[
'compilation result not loaded. Cannot build internal call tree'
])
}
else
{
}
else
{
buildTree
(
this
,
0
,
''
).
then
((
result
)
=>
{
buildTree
(
this
,
0
,
''
,
true
).
then
((
result
)
=>
{
if
(
result
.
error
)
{
if
(
result
.
error
)
{
this
.
event
.
trigger
(
'callTreeBuildFailed'
,
[
result
.
error
])
this
.
event
.
trigger
(
'callTreeBuildFailed'
,
[
result
.
error
])
}
else
{
}
else
{
...
@@ -104,7 +104,7 @@ class InternalCallTree {
...
@@ -104,7 +104,7 @@ class InternalCallTree {
}
}
}
}
async
function
buildTree
(
tree
,
step
,
scopeId
)
{
async
function
buildTree
(
tree
,
step
,
scopeId
,
isExternalCall
)
{
let
subScope
=
1
let
subScope
=
1
tree
.
scopeStarts
[
step
]
=
scopeId
tree
.
scopeStarts
[
step
]
=
scopeId
tree
.
scopes
[
scopeId
]
=
{
firstStep
:
step
,
locals
:
{}
}
tree
.
scopes
[
scopeId
]
=
{
firstStep
:
step
,
locals
:
{}
}
...
@@ -140,10 +140,10 @@ async function buildTree (tree, step, scopeId) {
...
@@ -140,10 +140,10 @@ async function buildTree (tree, step, scopeId) {
if
(
!
sourceLocation
)
{
if
(
!
sourceLocation
)
{
return
{
outStep
:
step
,
error
:
'InternalCallTree - No source Location. '
+
step
}
return
{
outStep
:
step
,
error
:
'InternalCallTree - No source Location. '
+
step
}
}
}
if
(
traceHelper
.
isCallInstruction
(
tree
.
traceManager
.
trace
[
step
])
||
var
isCallInstruction
=
traceHelper
.
isCallInstruction
(
tree
.
traceManager
.
trace
[
step
])
sourceLocation
.
jump
===
'i'
)
{
if
(
isCallInstruction
||
sourceLocation
.
jump
===
'i'
)
{
try
{
try
{
var
externalCallResult
=
await
buildTree
(
tree
,
step
+
1
,
scopeId
===
''
?
subScope
.
toString
()
:
scopeId
+
'.'
+
subScope
)
var
externalCallResult
=
await
buildTree
(
tree
,
step
+
1
,
scopeId
===
''
?
subScope
.
toString
()
:
scopeId
+
'.'
+
subScope
,
isCallInstruction
)
if
(
externalCallResult
.
error
)
{
if
(
externalCallResult
.
error
)
{
return
{
outStep
:
step
,
error
:
'InternalCallTree - '
+
externalCallResult
.
error
}
return
{
outStep
:
step
,
error
:
'InternalCallTree - '
+
externalCallResult
.
error
}
}
else
{
}
else
{
...
@@ -153,7 +153,7 @@ async function buildTree (tree, step, scopeId) {
...
@@ -153,7 +153,7 @@ async function buildTree (tree, step, scopeId) {
}
catch
(
e
)
{
}
catch
(
e
)
{
return
{
outStep
:
step
,
error
:
'InternalCallTree - '
+
e
.
message
}
return
{
outStep
:
step
,
error
:
'InternalCallTree - '
+
e
.
message
}
}
}
}
else
if
(
sourceLocation
.
jump
===
'o'
||
callDepthChange
(
step
,
tree
.
traceManager
.
trace
))
{
}
else
if
(
(
isExternalCall
&&
callDepthChange
(
step
,
tree
.
traceManager
.
trace
))
||
(
!
isExternalCall
&&
sourceLocation
.
jump
===
'o'
))
{
tree
.
scopes
[
scopeId
].
lastStep
=
step
tree
.
scopes
[
scopeId
].
lastStep
=
step
return
{
outStep
:
step
+
1
}
return
{
outStep
:
step
+
1
}
}
else
{
}
else
{
...
...
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