[all-commits] [llvm/llvm-project] 7d67a1: [dsymutil] Fix memory issue in the BinaryHolder

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Wed Apr 27 16:36:02 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7d67a1e45a04854506b1d14f219c643489d6d78e
      https://github.com/llvm/llvm-project/commit/7d67a1e45a04854506b1d14f219c643489d6d78e
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2022-04-27 (Wed, 27 Apr 2022)

  Changed paths:
    M llvm/tools/dsymutil/BinaryHolder.cpp
    M llvm/tools/dsymutil/BinaryHolder.h

  Log Message:
  -----------
  [dsymutil] Fix memory issue in the BinaryHolder

The BinaryHolder has two caches for object and archive entries. These
are implemented as StringMaps of ObjectEntry and ArchiveEntry
respectively. The fact that they're stored by value is problematic
because the BinaryHolder hands out references that become invalidate
when the data structure grows. This patch wraps those object instances
in unique pointers and changes the interface to hand out pointers. This
resulted in transient failures.

rdar://90412671

Differential revision: https://reviews.llvm.org/D124567




More information about the All-commits mailing list