@@ -507,6 +507,8 @@ void DwarfDebug::addSourceLine(DIE *Die, DIVariable V) {
507
507
return ;
508
508
509
509
unsigned Line = V.getLineNumber ();
510
+ if (Line == 0 )
511
+ return ;
510
512
unsigned FileID = GetOrCreateSourceID (V.getContext ().getDirectory (),
511
513
V.getContext ().getFilename ());
512
514
assert (FileID && " Invalid file id" );
@@ -522,6 +524,8 @@ void DwarfDebug::addSourceLine(DIE *Die, DIGlobalVariable G) {
522
524
return ;
523
525
524
526
unsigned Line = G.getLineNumber ();
527
+ if (Line == 0 )
528
+ return ;
525
529
unsigned FileID = GetOrCreateSourceID (G.getContext ().getDirectory (),
526
530
G.getContext ().getFilename ());
527
531
assert (FileID && " Invalid file id" );
@@ -557,7 +561,7 @@ void DwarfDebug::addSourceLine(DIE *Die, DIType Ty) {
557
561
return ;
558
562
559
563
unsigned Line = Ty.getLineNumber ();
560
- if (!Ty.getContext ().Verify ())
564
+ if (Line == 0 || !Ty.getContext ().Verify ())
561
565
return ;
562
566
unsigned FileID = GetOrCreateSourceID (Ty.getContext ().getDirectory (),
563
567
Ty.getContext ().getFilename ());
@@ -574,6 +578,8 @@ void DwarfDebug::addSourceLine(DIE *Die, DINameSpace NS) {
574
578
return ;
575
579
576
580
unsigned Line = NS.getLineNumber ();
581
+ if (Line == 0 )
582
+ return ;
577
583
StringRef FN = NS.getFilename ();
578
584
StringRef Dir = NS.getDirectory ();
579
585
0 commit comments