Commit 55fb6ba
Andres Madrid Ucha
Clang: Fix mismatch in elementtype
When processing thunk functions and elementtypes with
inheritance, there were logic errors in the direct base checking
that could lead to incorrect function types being retained.
The issue occurred in the following case:
1. Initial comparison: CurrentThisStructTy (ios_base) == NewThisTy (ios_base)
- Both types are the same, so NewIsDirectBase is incorrectly set to true
- ThunkFn type: void (%class._ZSt8ios_base*)
- ThunkFnTy: (%class._ZSt8ios_base*)
- Since types match, no update occurs
2. Second comparison: CurrentThisStructTy != NewThisTy
- ThunkFn then gets updated to void (%class._ZSt9basic_iosIcSt11char_traitsIcEE*)
- This is correct behavior
3. Third comparison: Same types again (ios_base == ios_base)
- NewIsDirectBase is again set to true, which will then affect updating the ThunkFn
- Current ThunkFn: void (%class._ZSt9basic_iosIcSt11char_traitsIcEE*)
but the one we want to update to is void (%class._ZSt8ios_base*)
- Because NewIsDirectBase is true, the update is skipped eventhough
ThunkFn != ThunkFnTy. This leaves ThunkFn with the wrong type1 parent 8907c03 commit 55fb6ba
1 file changed
+20
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
586 | 586 | | |
587 | 587 | | |
588 | 588 | | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
589 | 593 | | |
590 | 594 | | |
591 | 595 | | |
592 | | - | |
| 596 | + | |
593 | 597 | | |
594 | 598 | | |
595 | 599 | | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
602 | 608 | | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
608 | 614 | | |
609 | 615 | | |
610 | 616 | | |
| 617 | + | |
611 | 618 | | |
612 | 619 | | |
613 | | - | |
614 | 620 | | |
615 | 621 | | |
616 | 622 | | |
| |||
634 | 640 | | |
635 | 641 | | |
636 | 642 | | |
| 643 | + | |
637 | 644 | | |
638 | 645 | | |
639 | 646 | | |
| |||
0 commit comments