summaryrefslogtreecommitdiff
path: root/lib/DebugInfo/DWARFContext.h
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-11-12 14:25:36 +0000
committerAlexey Samsonov <samsonov@google.com>2012-11-12 14:25:36 +0000
commit4c0ae9066fecbbd507162a880450641aa5c33098 (patch)
tree9fd68167d4944186f5015d3da5eec854da240b02 /lib/DebugInfo/DWARFContext.h
parent30d8f0e9770db76f19273419c57fe112129b145a (diff)
downloadllvm-4c0ae9066fecbbd507162a880450641aa5c33098.tar.gz
llvm-4c0ae9066fecbbd507162a880450641aa5c33098.tar.bz2
llvm-4c0ae9066fecbbd507162a880450641aa5c33098.tar.xz
Fixup for r167558: Store raw pointer (instead of reference) to RelocMap in DIContext. This is needed to prevent crashes because of dangling reference if the clients don't provide RelocMap to DIContext constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167728 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/DebugInfo/DWARFContext.h')
-rw-r--r--lib/DebugInfo/DWARFContext.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/DebugInfo/DWARFContext.h b/lib/DebugInfo/DWARFContext.h
index 4001792b3d..d3e9470a84 100644
--- a/lib/DebugInfo/DWARFContext.h
+++ b/lib/DebugInfo/DWARFContext.h
@@ -26,7 +26,7 @@ namespace llvm {
/// methods that a concrete implementation provides.
class DWARFContext : public DIContext {
bool IsLittleEndian;
- const RelocAddrMap &RelocMap;
+ const RelocAddrMap *RelocMap;
SmallVector<DWARFCompileUnit, 1> CUs;
OwningPtr<DWARFDebugAbbrev> Abbrev;
@@ -39,7 +39,7 @@ class DWARFContext : public DIContext {
/// Read compile units from the debug_info section and store them in CUs.
void parseCompileUnits();
protected:
- DWARFContext(bool isLittleEndian, const RelocAddrMap &Map) :
+ DWARFContext(bool isLittleEndian, const RelocAddrMap *Map) :
IsLittleEndian(isLittleEndian), RelocMap(Map) {}
public:
virtual void dump(raw_ostream &OS);
@@ -73,7 +73,7 @@ public:
DILineInfoSpecifier Specifier = DILineInfoSpecifier());
bool isLittleEndian() const { return IsLittleEndian; }
- const RelocAddrMap &relocMap() const { return RelocMap; }
+ const RelocAddrMap *relocMap() const { return RelocMap; }
virtual StringRef getInfoSection() = 0;
virtual StringRef getAbbrevSection() = 0;
@@ -113,7 +113,7 @@ public:
StringRef lineSection,
StringRef stringSection,
StringRef rangeSection,
- const RelocAddrMap &Map = RelocAddrMap())
+ const RelocAddrMap *Map = 0)
: DWARFContext(isLittleEndian, Map),
InfoSection(infoSection),
AbbrevSection(abbrevSection),