From c9088eac0cee995ad73ebaa2f7e1285c9865642a Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 6 Dec 2022 10:27:34 +0100 Subject: [PATCH] fix parsing the var in multiple scope --- libs/remix-debug/src/solidity-decoder/internalCallTree.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index 391dd69efd..20a619174e 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -492,7 +492,7 @@ function addParams (parameterList, tree, scopeId, states, contractObj, sourceLoc let location = extractLocationFromAstVariable(param) location = location === 'default' ? 'memory' : location const attributesName = param.name === '' ? `$${inputParam}` : param.name - tree.scopes[scopeId].locals[attributesName] = { + const newParam = { name: attributesName, type: parseType(param.typeDescriptions.typeString, states, contractName, location), stackDepth: stackDepth, @@ -500,7 +500,9 @@ function addParams (parameterList, tree, scopeId, states, contractObj, sourceLoc abi: contractObj.contract.abi, isParameter: true } + tree.scopes[scopeId].locals[attributesName] = newParam params.push(attributesName) + if (!tree.variables[param.id]) tree.variables[param.id] = newParam } stackPosition += dir }