commit f4ee46e8395228cdcb1d5f7f2ac8b4ebd955b07f (tree)
parent c8b78706b74d16ed21113096d2b47717abb53d4d
Author: Andrew Kelley <andrew@ziglang.org>
Date: Sun, 16 May 2021 14:20:51 -0700
MachO/DebugSymbols: fix debug line offset
In c8b78706b74d16ed21113096d2b47717abb53d4d I incorrectly made it be the
line offset from Decl to function lbrace; it needed to be line offset
from lbrace to rbrace.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/link/MachO/DebugSymbols.zig b/src/link/MachO/DebugSymbols.zig
@@ -1064,7 +1064,7 @@ pub fn commitDeclDebugInfo(
try dbg_line_buffer.append(DW.LNS_advance_line);
const func = decl.val.castTag(.function).?.data;
- const line_off = @intCast(u28, decl.src_line + func.lbrace_line);
+ const line_off = @intCast(u28, func.rbrace_line - func.lbrace_line);
try leb.writeULEB128(dbg_line_buffer.writer(), line_off);
}