From 4e64373fc07a1e24735bcbdfd463e11839c8c273 Mon Sep 17 00:00:00 2001 From: Veikka Tuominen Date: Fri, 30 Dec 2022 14:28:04 +0200 Subject: fix generic function arg debug info referencing wrong parameter Closes #14123 --- src/arch/wasm/CodeGen.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/arch/wasm/CodeGen.zig') diff --git a/src/arch/wasm/CodeGen.zig b/src/arch/wasm/CodeGen.zig index 21d7926978..c27639e14a 100644 --- a/src/arch/wasm/CodeGen.zig +++ b/src/arch/wasm/CodeGen.zig @@ -2474,8 +2474,8 @@ fn airArg(func: *CodeGen, inst: Air.Inst.Index) InnerError!void { switch (func.debug_output) { .dwarf => |dwarf| { - // TODO: Get the original arg index rather than wasm arg index - const name = func.mod_fn.getParamName(func.bin_file.base.options.module.?, arg_index); + const src_index = func.air.instructions.items(.data)[inst].arg.src_index; + const name = func.mod_fn.getParamName(func.bin_file.base.options.module.?, src_index); try dwarf.genArgDbgInfo(name, arg_ty, .wasm, func.mod_fn.owner_decl, .{ .wasm_local = arg.local.value, }); -- cgit v1.2.3