fix decoding function parameters

pull/3068/head
yann300 2 years ago
parent 3f09a954a5
commit cc2ff24bcc
  1. 5
      libs/remix-debug/src/solidity-decoder/internalCallTree.ts
  2. 2
      libs/remix-debug/src/solidity-decoder/localDecoder.ts

@ -206,7 +206,7 @@ async function buildTree (tree, step, scopeId, isCreation, functionDefinition?,
tree.scopes[scopeId] = { firstStep: step, locals: {}, isCreation, gasCost: 0 } tree.scopes[scopeId] = { firstStep: step, locals: {}, isCreation, gasCost: 0 }
if (functionDefinition) { if (functionDefinition) {
await registerFunctionParameters(tree, functionDefinition, step, scopeId, contractObj, sourceLocation) await registerFunctionParameters(tree, functionDefinition, step, scopeId, contractObj, validSourceLocation)
} }
function callDepthChange (step, trace) { function callDepthChange (step, trace) {
@ -470,7 +470,8 @@ function addParams (parameterList, tree, scopeId, states, contractObj, sourceLoc
type: parseType(param.typeDescriptions.typeString, states, contractName, location), type: parseType(param.typeDescriptions.typeString, states, contractName, location),
stackDepth: stackDepth, stackDepth: stackDepth,
sourceLocation: sourceLocation, sourceLocation: sourceLocation,
abi: contractObj.contract.abi abi: contractObj.contract.abi,
isParameter: true
} }
params.push(attributesName) params.push(attributesName)
} }

@ -11,7 +11,7 @@ export async function solidityLocals (vmtraceIndex, internalTreeCall, stack, mem
let anonymousIncr = 1 let anonymousIncr = 1
for (const local in scope.locals) { for (const local in scope.locals) {
const variable = scope.locals[local] 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 let name = variable.name
if (name.indexOf('$') !== -1) { if (name.indexOf('$') !== -1) {
name = '<' + anonymousIncr + '>' name = '<' + anonymousIncr + '>'

Loading…
Cancel
Save