Commit fe7a9a1e authored by yann300's avatar yann300

external call

parent 3c0339bd
......@@ -4,6 +4,7 @@ var AstWalker = require('./astWalker')
var EventManager = require('../lib/eventManager')
var decodeInfo = require('../solidity/decodeInfo')
var util = require('../helpers/util')
var traceHelper = require('../helpers/traceHelper')
/**
* Tree representing internal jump into function.
......@@ -96,7 +97,7 @@ async function buildTree (tree, step, scopeId) {
if (!sourceLocation) {
return { outStep: step, error: 'InternalCallTree - No source Location. ' + step }
}
if (sourceLocation.jump === 'i') {
if (sourceLocation.jump === 'i' || traceHelper.isCallInstruction(tree.traceManager.trace[step])) {
try {
var result = await buildTree(tree, step + 1, scopeId === '' ? subScope.toString() : scopeId + '.' + subScope)
if (result.error) {
......@@ -108,7 +109,8 @@ async function buildTree (tree, step, scopeId) {
} catch (e) {
return { outStep: step, error: 'InternalCallTree - ' + e.message }
}
} else if (sourceLocation.jump === 'o') {
} else if (sourceLocation.jump === 'o' || traceHelper.isReturnInstruction(tree.traceManager.trace[step]) || traceHelper.isStopInstruction(tree.traceManager.trace[step])) {
// traceHelper.isReturnInstruction should be replaced by a more complex structure so it can handle out of gas
tree.scopes[scopeId].lastStep = step
return { outStep: step + 1 }
} else {
......
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