[all-commits] [llvm/llvm-project] 159b94: [ELF] ObjFile<ELFT>::initializeSymbols: don't call...

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed Dec 15 18:22:01 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 159b948e434556fa6c397066e0a13a893cc6a7d0
      https://github.com/llvm/llvm-project/commit/159b948e434556fa6c397066e0a13a893cc6a7d0
  Author: Fangrui Song <i at maskray.me>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M lld/ELF/InputFiles.cpp

  Log Message:
  -----------
  [ELF] ObjFile<ELFT>::initializeSymbols: don't call Allocate when firstGlobal==0

Calling `Allocate` with 0 size (when .symtab is absent, e.g.
`invalid/mips-invalid-options-descriptor.test`) may return a nullptr, which will
crash with -fsanitize=null (the underlying `Allocate` function is
LLVM_ATTRIBUTE_RETURNS_NONNULL).




More information about the All-commits mailing list