Commit dcdf20d9 authored by yann300's avatar yann300

fix internal call tree

parent 6b29bbbb
...@@ -55,7 +55,7 @@ class InternalCallTree { ...@@ -55,7 +55,7 @@ class InternalCallTree {
function buildTree (tree, step, scopeId, trace) { function buildTree (tree, step, scopeId, trace) {
let subScope = 1 let subScope = 1
tree.scopeStarts[step] = scopeId tree.scopeStarts[step] = scopeId
tree.scopes[scopeId] = { firstStep: step } tree.scopes[scopeId] = { firstStep: step, locals: {} }
while (step < trace.length) { while (step < trace.length) {
var sourceLocation var sourceLocation
extractSourceLocation(tree, step, (error, src) => { extractSourceLocation(tree, step, (error, src) => {
...@@ -74,10 +74,7 @@ function buildTree (tree, step, scopeId, trace) { ...@@ -74,10 +74,7 @@ function buildTree (tree, step, scopeId, trace) {
} else { } else {
if (tree.includeLocalsVariables) { if (tree.includeLocalsVariables) {
var variableDeclaration = resolveVariableDeclaration(tree, step, sourceLocation) var variableDeclaration = resolveVariableDeclaration(tree, step, sourceLocation)
if (variableDeclaration) { if (variableDeclaration && !tree.scopes[scopeId].locals[variableDeclaration.attributes.name]) {
if (!tree.scopes[scopeId].locals) {
tree.scopes[scopeId].locals = {}
}
tree.traceManager.getStackAt(step, (error, stack) => { tree.traceManager.getStackAt(step, (error, stack) => {
if (!error) { if (!error) {
tree.solidityProxy.contractNameAt(step, (error, contractName) => { // cached tree.solidityProxy.contractNameAt(step, (error, contractName) => { // cached
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment