diff options
author | Adrian Prantl <aprantl@apple.com> | 2017-03-22 16:50:16 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2017-03-22 16:50:16 +0000 |
commit | 5503077cdea0ea106598d5a2278e7c10b634dc84 (patch) | |
tree | fc4009cea2649e7e496836b52bd4f65261b5211a /llvm/lib | |
parent | 17e228f30977402650120b3a0138a835a90494a5 (diff) | |
download | bcm5719-llvm-5503077cdea0ea106598d5a2278e7c10b634dc84.tar.gz bcm5719-llvm-5503077cdea0ea106598d5a2278e7c10b634dc84.zip |
Fix PR32298 by adding an early exit to getFrameIndexExprs().
Also add an assertion for the case that there are multiple FI
expressions with a DW_OP_LLVM_fragment; which should violate internal
constraints in DbgVariable.
llvm-svn: 298518
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 15e5be2e65d..344528d5cfb 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -199,6 +199,12 @@ const DIType *DbgVariable::getType() const { } ArrayRef<DbgVariable::FrameIndexExpr> DbgVariable::getFrameIndexExprs() const { + if (FrameIndexExprs.size() == 1) + return FrameIndexExprs; + + assert(all_of(FrameIndexExprs, + [](const FrameIndexExpr &A) { return A.Expr->isFragment(); }) && + "multiple FI expressions without DW_OP_LLVM_fragment"); std::sort(FrameIndexExprs.begin(), FrameIndexExprs.end(), [](const FrameIndexExpr &A, const FrameIndexExpr &B) -> bool { return A.Expr->getFragmentInfo()->OffsetInBits < |