zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 79f8cf1326d63fd4e355aa0c0856617698afd867 (tree)
parent 06b85a4fd00bee590ec908d9f32c0263982f13c3
Author: Justus Klausecker <justus@klausecker.de>
Date:   Fri, 20 Mar 2026 17:19:28 +0100

std.debug.Info: make Mach-O source location resolution more resilient

`resolveAddresses` now also works if some calls to `getDwarfForAddress`
fail with `error.MissingDebugInfo`; the affected source location is set
to `.invalid`.

This makes fuzzing work with `ReleaseSafe` for Mach-O.

Diffstat:
Mlib/std/debug/Info.zig | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/lib/std/debug/Info.zig b/lib/std/debug/Info.zig @@ -99,6 +99,10 @@ pub fn resolveAddresses( // due to split debug information. For now, we'll just resolve the addreses one by one. for (sorted_pc_addrs, output) |pc_addr, *src_loc| { const dwarf, const dwarf_pc_addr = mf.getDwarfForAddress(gpa, io, pc_addr) catch |err| switch (err) { + error.MissingDebugInfo => { + src_loc.* = .invalid; + continue; + }, error.InvalidMachO, error.InvalidDwarf => return error.InvalidDebugInfo, else => |e| return e, };