fix parsing the var in multiple scope

pull/5370/head
yann300 2 years ago committed by Aniket
parent 9e761dfe69
commit c9088eac0c
  1. 4
      libs/remix-debug/src/solidity-decoder/internalCallTree.ts

@ -492,7 +492,7 @@ function addParams (parameterList, tree, scopeId, states, contractObj, sourceLoc
let location = extractLocationFromAstVariable(param) let location = extractLocationFromAstVariable(param)
location = location === 'default' ? 'memory' : location location = location === 'default' ? 'memory' : location
const attributesName = param.name === '' ? `$${inputParam}` : param.name const attributesName = param.name === '' ? `$${inputParam}` : param.name
tree.scopes[scopeId].locals[attributesName] = { const newParam = {
name: attributesName, name: attributesName,
type: parseType(param.typeDescriptions.typeString, states, contractName, location), type: parseType(param.typeDescriptions.typeString, states, contractName, location),
stackDepth: stackDepth, stackDepth: stackDepth,
@ -500,7 +500,9 @@ function addParams (parameterList, tree, scopeId, states, contractObj, sourceLoc
abi: contractObj.contract.abi, abi: contractObj.contract.abi,
isParameter: true isParameter: true
} }
tree.scopes[scopeId].locals[attributesName] = newParam
params.push(attributesName) params.push(attributesName)
if (!tree.variables[param.id]) tree.variables[param.id] = newParam
} }
stackPosition += dir stackPosition += dir
} }

Loading…
Cancel
Save