From 5535ca77ad7cb60058dada3ab9881425834d424f Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 24 Nov 2022 10:18:26 +0100 Subject: [PATCH] fix decoding function parameters --- libs/remix-debug/src/solidity-decoder/internalCallTree.ts | 5 +++-- libs/remix-debug/src/solidity-decoder/localDecoder.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index f47db893ac..cd378c665b 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -206,7 +206,7 @@ async function buildTree (tree, step, scopeId, isCreation, functionDefinition?, tree.scopes[scopeId] = { firstStep: step, locals: {}, isCreation, gasCost: 0 } if (functionDefinition) { - await registerFunctionParameters(tree, functionDefinition, step, scopeId, contractObj, sourceLocation) + await registerFunctionParameters(tree, functionDefinition, step, scopeId, contractObj, validSourceLocation) } function callDepthChange (step, trace) { @@ -470,7 +470,8 @@ function addParams (parameterList, tree, scopeId, states, contractObj, sourceLoc type: parseType(param.typeDescriptions.typeString, states, contractName, location), stackDepth: stackDepth, sourceLocation: sourceLocation, - abi: contractObj.contract.abi + abi: contractObj.contract.abi, + isParameter: true } params.push(attributesName) } diff --git a/libs/remix-debug/src/solidity-decoder/localDecoder.ts b/libs/remix-debug/src/solidity-decoder/localDecoder.ts index d333622408..d7619ce12b 100644 --- a/libs/remix-debug/src/solidity-decoder/localDecoder.ts +++ b/libs/remix-debug/src/solidity-decoder/localDecoder.ts @@ -11,7 +11,7 @@ export async function solidityLocals (vmtraceIndex, internalTreeCall, stack, mem let anonymousIncr = 1 for (const local in scope.locals) { const variable = scope.locals[local] - if (variable.stackDepth < stack.length && variable.sourceLocation.start <= currentSourceLocation.start) { + if (variable.stackDepth < stack.length && (variable.sourceLocation.start <= currentSourceLocation.start || variable.isParameter)) { let name = variable.name if (name.indexOf('$') !== -1) { name = '<' + anonymousIncr + '>'