aboutsummaryrefslogtreecommitdiff
path: root/src/link/MachO/DebugSymbols.zig
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2021-01-19 08:58:51 +0100
committerGitHub <noreply@github.com>2021-01-19 08:58:51 +0100
commitd5b0a963d1bf3399e3d8b63b03ea61f7d771adbd (patch)
tree4ae07939bc49274fb769cf91416ee002c8b66ebf /src/link/MachO/DebugSymbols.zig
parent30a824cb9e148adb0799a0a81721160c0d474b50 (diff)
parenta2ebe3c82c89084a3672593cb34f259fca5a5e30 (diff)
downloadzig-d5b0a963d1bf3399e3d8b63b03ea61f7d771adbd.tar.gz
zig-d5b0a963d1bf3399e3d8b63b03ea61f7d771adbd.zip
Merge pull request #7818 from kubkon/macho-more-cleanup
Macho more cleanup
Diffstat (limited to 'src/link/MachO/DebugSymbols.zig')
-rw-r--r--src/link/MachO/DebugSymbols.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/link/MachO/DebugSymbols.zig b/src/link/MachO/DebugSymbols.zig
index fb7488a12c..fc58c1e552 100644
--- a/src/link/MachO/DebugSymbols.zig
+++ b/src/link/MachO/DebugSymbols.zig
@@ -1079,7 +1079,8 @@ pub fn commitDeclDebugInfo(
const debug_line_sect = &dwarf_segment.sections.items[self.debug_line_section_index.?];
const src_fn = &decl.fn_link.macho;
src_fn.len = @intCast(u32, dbg_line_buffer.items.len);
- if (self.dbg_line_fn_last) |last| {
+ if (self.dbg_line_fn_last) |last| blk: {
+ if (src_fn == last) break :blk;
if (src_fn.next) |next| {
// Update existing function - non-last item.
if (src_fn.off + src_fn.len + min_nop_size > next.off) {
@@ -1238,7 +1239,8 @@ fn updateDeclDebugInfoAllocation(
const dwarf_segment = &self.load_commands.items[self.dwarf_segment_cmd_index.?].Segment;
const debug_info_sect = &dwarf_segment.sections.items[self.debug_info_section_index.?];
text_block.dbg_info_len = len;
- if (self.dbg_info_decl_last) |last| {
+ if (self.dbg_info_decl_last) |last| blk: {
+ if (text_block == last) break :blk;
if (text_block.dbg_info_next) |next| {
// Update existing Decl - non-last item.
if (text_block.dbg_info_off + text_block.dbg_info_len + min_nop_size > next.dbg_info_off) {