diff --git a/remix-solidity/src/decoder/internalCallTree.js b/remix-solidity/src/decoder/internalCallTree.js index 04276e2bb3..2e5218f1ac 100644 --- a/remix-solidity/src/decoder/internalCallTree.js +++ b/remix-solidity/src/decoder/internalCallTree.js @@ -271,11 +271,14 @@ function extractFunctionDefinitions (ast, astWalker) { function addParams (parameterList, tree, scopeId, states, contractName, sourceLocation, stackLength, stackPosition, dir) { for (var inputParam in parameterList.children) { var param = parameterList.children[inputParam] - tree.scopes[scopeId].locals[param.attributes.name] = { - name: param.attributes.name, - type: decodeInfo.parseType(param.attributes.type, states, contractName), - stackDepth: stackLength + (dir * stackPosition), - sourceLocation: sourceLocation + var stackDepth = stackLength + (dir * stackPosition) + if (stackDepth >= 0) { + tree.scopes[scopeId].locals[param.attributes.name] = { + name: param.attributes.name, + type: decodeInfo.parseType(param.attributes.type, states, contractName), + stackDepth: stackDepth, + sourceLocation: sourceLocation + } } stackPosition += dir }