Commit 095a18a
authored
Fix and test infinite recursion in LLVM debug data emission (#11108)
There's a bug with the debug info in the LLVM emitter, where a struct
that references itself (even through a pointer) causes infinite
recursion and the compiler crashing.
For example, the following would cause the crash when `-g3` is
specified:
```slang
struct SelfReferential
{
SelfReferential* self;
}
```
This is kind-of a hotfix, because it is blocking me in my own project
(but I'm already running my own branch with all of my PRs merged on that
one, so no rush to actually merge this.) This simple approach can result
in the loss of some type info in debug data when these problematic
cycles are formed; there may be a better way that would retain this
info, but that would likely require more thorough refactoring.1 parent 29cd386 commit 095a18a
4 files changed
Lines changed: 87 additions & 13 deletions
File tree
- source
- slang-llvm
- slang
- tests/bugs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
368 | 372 | | |
369 | 373 | | |
370 | 374 | | |
| |||
719 | 723 | | |
720 | 724 | | |
721 | 725 | | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
722 | 731 | | |
723 | 732 | | |
724 | 733 | | |
725 | 734 | | |
726 | 735 | | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | 736 | | |
733 | 737 | | |
734 | 738 | | |
| |||
1800 | 1804 | | |
1801 | 1805 | | |
1802 | 1806 | | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
1803 | 1830 | | |
1804 | 1831 | | |
1805 | 1832 | | |
| |||
2349 | 2376 | | |
2350 | 2377 | | |
2351 | 2378 | | |
2352 | | - | |
| 2379 | + | |
2353 | 2380 | | |
2354 | 2381 | | |
2355 | 2382 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
329 | 335 | | |
330 | 336 | | |
331 | 337 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| 171 | + | |
| 172 | + | |
171 | 173 | | |
172 | 174 | | |
173 | 175 | | |
| |||
453 | 455 | | |
454 | 456 | | |
455 | 457 | | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
456 | 472 | | |
457 | 473 | | |
458 | 474 | | |
| |||
466 | 482 | | |
467 | 483 | | |
468 | 484 | | |
469 | | - | |
470 | | - | |
| 485 | + | |
| 486 | + | |
471 | 487 | | |
472 | 488 | | |
473 | 489 | | |
474 | | - | |
| 490 | + | |
475 | 491 | | |
476 | 492 | | |
477 | 493 | | |
478 | 494 | | |
479 | 495 | | |
480 | 496 | | |
481 | | - | |
482 | | - | |
483 | 497 | | |
484 | 498 | | |
485 | 499 | | |
| |||
489 | 503 | | |
490 | 504 | | |
491 | 505 | | |
| 506 | + | |
492 | 507 | | |
493 | 508 | | |
494 | 509 | | |
| |||
688 | 703 | | |
689 | 704 | | |
690 | 705 | | |
691 | | - | |
| 706 | + | |
692 | 707 | | |
693 | 708 | | |
694 | 709 | | |
695 | 710 | | |
696 | 711 | | |
697 | | - | |
| 712 | + | |
698 | 713 | | |
699 | 714 | | |
700 | 715 | | |
| |||
2862 | 2877 | | |
2863 | 2878 | | |
2864 | 2879 | | |
| 2880 | + | |
| 2881 | + | |
| 2882 | + | |
| 2883 | + | |
| 2884 | + | |
| 2885 | + | |
2865 | 2886 | | |
2866 | 2887 | | |
2867 | 2888 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
0 commit comments