mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 18:24:00 +00:00
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
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user