authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-10-09 17:14:31+03:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-10-09 21:00:31-07:00
logb2c36b14de97a2333a9db761c54ae86bd483cb1d
tree766bd696c31e9efa3c782c4541264bbb13ad7cef
parent1f6d82ec01b09b7a8a6285810dd4c68624621df3

Sema: fix `dbg_inline` instructions not being emitted

This broke with #16604 but went unnoticed due to lack of tests. Closes #17444

1 files changed, 3 insertions(+), 2 deletions(-)

src/Sema.zig+3-2
......@@ -7281,6 +7281,7 @@ fn analyzeCall(
72817281 .needed_comptime_reason = "function being called at comptime must be comptime-known",
72827282 .block_comptime_reason = comptime_reason,
72837283 });
7284 const prev_fn_index = sema.func_index;
72847285 const module_fn_index = switch (mod.intern_pool.indexToKey(func_val.toIntern())) {
72857286 .extern_func => return sema.fail(block, call_src, "{s} call of extern function", .{
72867287 @as([]const u8, if (is_comptime_call) "comptime" else "inline"),
......@@ -7478,7 +7479,7 @@ fn analyzeCall(
74787479 new_fn_info.return_type = sema.fn_ret_ty.toIntern();
74797480 const new_func_resolved_ty = try mod.funcType(new_fn_info);
74807481 if (!is_comptime_call and !block.is_typeof) {
7481 try sema.emitDbgInline(block, sema.func_index, module_fn_index, new_func_resolved_ty, .dbg_inline_begin);
7482 try sema.emitDbgInline(block, prev_fn_index, module_fn_index, new_func_resolved_ty, .dbg_inline_begin);
74827483
74837484 const zir_tags = sema.code.instructions.items(.tag);
74847485 for (fn_info.param_body) |param| switch (zir_tags[param]) {
......@@ -7519,7 +7520,7 @@ fn analyzeCall(
75197520 try sema.emitDbgInline(
75207521 block,
75217522 module_fn_index,
7522 sema.func_index,
7523 prev_fn_index,
75237524 mod.funcOwnerDeclPtr(sema.func_index).ty,
75247525 .dbg_inline_end,
75257526 );