diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-12-30 14:28:04 +0200 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-12-30 17:00:50 +0200 |
| commit | 4e64373fc07a1e24735bcbdfd463e11839c8c273 (patch) | |
| tree | e59da20f467d336240c12cdc832834f22f361b30 /src/arch/wasm/CodeGen.zig | |
| parent | 4b5fc5239c37fa3f49965188256a781c7b1277a3 (diff) | |
| download | zig-4e64373fc07a1e24735bcbdfd463e11839c8c273.tar.gz zig-4e64373fc07a1e24735bcbdfd463e11839c8c273.zip | |
fix generic function arg debug info referencing wrong parameter
Closes #14123
Diffstat (limited to 'src/arch/wasm/CodeGen.zig')
| -rw-r--r-- | src/arch/wasm/CodeGen.zig | 4 |
1 files changed, 2 insertions, 2 deletions
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, }); |
