@@ -389,3 +389,32 @@ func TestPathJoin(t *testing.T) {
389
389
}
390
390
}
391
391
}
392
+
393
+ func TestPathLineReaderMalformed (t * testing.T ) {
394
+ // This test case drawn from issue #52354. What's happening
395
+ // here is that the stmtList attribute in the compilation
396
+ // unit is malformed (negative).
397
+ var aranges , frame , pubnames , ranges , str []byte
398
+ abbrev := []byte {0x10 , 0x20 , 0x20 , 0x20 , 0x21 , 0x20 , 0x10 , 0x21 , 0x61 ,
399
+ 0x0 , 0x0 , 0xff , 0x20 , 0xff , 0x20 , 0x20 , 0x20 , 0x20 , 0x20 , 0x20 ,
400
+ 0x20 , 0x20 , 0x20 , 0x20 , 0x20 , 0x20 }
401
+ info := []byte {0x0 , 0x0 , 0x0 , 0x9 , 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 ,
402
+ 0x20 , 0x10 , 0x10 }
403
+ line := []byte {0x20 }
404
+ Data0 , err := New (abbrev , aranges , frame , info , line , pubnames , ranges , str )
405
+ if err != nil {
406
+ t .Fatalf ("error unexpected: %v" , err )
407
+ }
408
+ Reader0 := Data0 .Reader ()
409
+ Entry0 , err := Reader0 .Next ()
410
+ if err != nil {
411
+ t .Fatalf ("error unexpected: %v" , err )
412
+ }
413
+ LineReader0 , err := Data0 .LineReader (Entry0 )
414
+ if err == nil {
415
+ t .Fatalf ("expected error" )
416
+ }
417
+ if LineReader0 != nil {
418
+ t .Fatalf ("expected nil line reader" )
419
+ }
420
+ }
0 commit comments