Details:
calling getMemoryBufferRef() on an empty archive can sometimes trigger segfault so the code should check before calling this.
this seems like a bug in the Archive API but that can be fixed separately.
P.S: follow up to D156468
Differential D157300
[lld-macho]Rework error-checking in peeking at first-member in archive to avoid segfault. oontvoo on Aug 7 2023, 10:44 AM. Authored by
Details
Details: P.S: follow up to D156468
Diff Detail
Event TimelineComment Actions
Is there a test case? When is "sometimes"? Comment Actions reducing the test-case further, I think it's safe to change "sometimes" => "100% of the time". (empty archive produced by llvm-ar --format=darwin rcs libempty.a Comment Actions LGTM with comments.
Comment Actions addressed review comment
|
Typo: BUffer -> Buffer
I think this would be cleaner as an early return, instead of nesting everything else inside it, since zero symbols should mean the loop below is a no-op as well.