From 4c0b3b0bbc75fe52be747af11135c7596b38721f Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 5 Feb 2020 15:22:52 +0530 Subject: [PATCH] anonymous locals rendering fixed --- remix-debug/src/solidity-decoder/internalCallTree.js | 7 ++++--- remix-debug/src/solidity-decoder/localDecoder.js | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/remix-debug/src/solidity-decoder/internalCallTree.js b/remix-debug/src/solidity-decoder/internalCallTree.js index b3274de1b6..f156277088 100644 --- a/remix-debug/src/solidity-decoder/internalCallTree.js +++ b/remix-debug/src/solidity-decoder/internalCallTree.js @@ -199,7 +199,7 @@ function includeVariableDeclaration (tree, step, sourceLocation, scopeId, newLoc // so, either this is the direct value, or the offset in memory. That depends on the type. if (!error) { tree.solidityProxy.contractNameAt(step, (error, contractName) => { // cached - if (!error) { + if (!error && variableDeclaration.attributes.name != '') { var states = tree.solidityProxy.extractStatesDefinitions() var location = typesUtil.extractLocationFromAstVariable(variableDeclaration) location = location === 'default' ? 'storage' : location @@ -297,8 +297,9 @@ function addParams (parameterList, tree, scopeId, states, contractName, sourceLo if (stackDepth >= 0) { let location = typesUtil.extractLocationFromAstVariable(param) location = location === 'default' ? 'memory' : location - tree.scopes[scopeId].locals[param.attributes.name] = { - name: param.attributes.name, + const attributesName = param.attributes.name === '' ? `$${inputParam}` : param.attributes.name + tree.scopes[scopeId].locals[attributesName] = { + name: attributesName, type: decodeInfo.parseType(param.attributes.type, states, contractName, location), stackDepth: stackDepth, sourceLocation: sourceLocation diff --git a/remix-debug/src/solidity-decoder/localDecoder.js b/remix-debug/src/solidity-decoder/localDecoder.js index 5cc2c35c6f..1a0fa28b36 100644 --- a/remix-debug/src/solidity-decoder/localDecoder.js +++ b/remix-debug/src/solidity-decoder/localDecoder.js @@ -13,7 +13,7 @@ async function solidityLocals (vmtraceIndex, internalTreeCall, stack, memory, st var variable = scope.locals[local] if (variable.stackDepth < stack.length && variable.sourceLocation.start <= currentSourceLocation.start) { let name = variable.name - if (name === '') { + if (name.indexOf('$') !== -1) { name = '<' + anonymousIncr + '>' anonymousIncr++ }