diff options
author | Devang Patel <dpatel@apple.com> | 2009-06-15 21:45:50 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-06-15 21:45:50 +0000 |
commit | 11a407f43fc0fb21df3156350175eaeeffaf7085 (patch) | |
tree | f16d6bb6bbb3d3126e9b08d1441d20a3da46ceae /lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 2077e18caf1425f83ce549913a1cffa0a4de192e (diff) |
Gracefully handle imbalanced inline function begin and end markers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73426 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index c773378bb0..1e04e2a67d 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1850,7 +1850,14 @@ unsigned DwarfDebug::RecordInlinedFnEnd(DISubprogram &SP) { } SmallVector<DbgScope *, 8> &Scopes = I->second; - assert(!Scopes.empty() && "We should have at least one debug scope!"); + if (Scopes.empty()) { + // Returned ID is 0 if this is unbalanced "end of inlined + // scope". This could happen if optimizer eats dbg intrinsics + // or "beginning of inlined scope" is not recoginized due to + // missing location info. In such cases, ignore this region.end. + return 0; + } + DbgScope *Scope = Scopes.back(); Scopes.pop_back(); unsigned ID = MMI->NextLabelID(); MMI->RecordUsedDbgLabel(ID); |