[all-commits] [llvm/llvm-project] 2d873d: [lld-macho]Rework error-checking in peeking at fir...

Vy Nguyen via All-commits all-commits at lists.llvm.org
Wed Aug 9 06:54:56 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2d873d5aa4f75053a9b74610bc96d7f7e65ee3ad
      https://github.com/llvm/llvm-project/commit/2d873d5aa4f75053a9b74610bc96d7f7e65ee3ad
  Author: Vy Nguyen <vyng at google.com>
  Date:   2023-08-09 (Wed, 09 Aug 2023)

  Changed paths:
    M lld/MachO/InputFiles.cpp
    M lld/test/MachO/force-load.s

  Log Message:
  -----------
  [lld-macho]Rework error-checking in peeking at first-member in archive to avoid segfault.

Details:
calling getMemoryBufferRef() on an empty archive can 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 Revision: https://reviews.llvm.org/D157300




More information about the All-commits mailing list