[all-commits] [llvm/llvm-project] 067f00: [lld][WebAssembly] Fix segfault in map file support

Thomas Lively via All-commits all-commits at lists.llvm.org
Tue Feb 9 14:43:04 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 067f005500af3093ee23d3c044f9b009c5bd94cf
      https://github.com/llvm/llvm-project/commit/067f005500af3093ee23d3c044f9b009c5bd94cf
  Author: Thomas Lively <tlively at google.com>
  Date:   2021-02-09 (Tue, 09 Feb 2021)

  Changed paths:
    M lld/test/wasm/map-file.s
    M lld/wasm/MapFile.cpp
    M lld/wasm/SyntheticSections.h

  Log Message:
  -----------
  [lld][WebAssembly] Fix segfault in map file support

The code previously assumed that `getChunk` would return a non-null pointer for
every symbol, but in fact it only returns non-null pointers for DefinedFunction
and DefinedData symbols. This patch fixes the segfault by checking whether
`getChunk` returns a null for each symbol and skipping the mapping output for
any symbols for which it does.

Differential Revision: https://reviews.llvm.org/D88369




More information about the All-commits mailing list