Skip to content

Commit d082043

Browse files
committedJan 23, 2018
Verifier: fix bug treating debug info issue as non-debug info issue
Normally when llvm-as sees only debug info errors in LLVM assembly, it simply drops the debug info and outputs a valid LLVM bitcode and returns 0. There is a bug in LLVM verifier which incorrectly treats a debug info error as non-debug info error, which causes llvm-as returns 1 even though llvm-as can drop the invalid debug info and outputs a valid LLVM bitcode. This patch fixes that. Differential Revision: https://reviews.llvm.org/D42391 llvm-svn: 323216
1 parent e642231 commit d082043

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎llvm/lib/IR/Verifier.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -4525,8 +4525,8 @@ void Verifier::visitDbgIntrinsic(StringRef Kind, DbgInfoIntrinsic &DII) {
45254525
// The scopes for variables and !dbg attachments must agree.
45264526
DILocalVariable *Var = DII.getVariable();
45274527
DILocation *Loc = DII.getDebugLoc();
4528-
Assert(Loc, "llvm.dbg." + Kind + " intrinsic requires a !dbg attachment",
4529-
&DII, BB, F);
4528+
AssertDI(Loc, "llvm.dbg." + Kind + " intrinsic requires a !dbg attachment",
4529+
&DII, BB, F);
45304530

45314531
DISubprogram *VarSP = getSubprogram(Var->getRawScope());
45324532
DISubprogram *LocSP = getSubprogram(Loc->getRawScope());

‎llvm/test/Verifier/llvm.dbg.intrinsic-dbg-attachment.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: not llvm-as -disable-output <%s 2>&1 | FileCheck %s
1+
; RUN: llvm-as -disable-output <%s 2>&1 | FileCheck %s
22
define void @foo() {
33
entry:
44
call void @llvm.dbg.value(

0 commit comments

Comments
 (0)
Please sign in to comment.