Commit 6b5de16
committed
Address discriminated __ptrauth should not be relocatable
After consideration, while "supportable" by relocation, it
seems much more reasonable for people to understand that
explicitly qualified types can have different relocatability
semantics.
Implicitly address discriminated fields should be relocatable
as developers in general cannot control those behaviours, hence
the trivial_relocation language explicitly acknowledges that
this impacts unions.
Explicitly address discriminated fields do however drastically
change the developer aware model of a type, and the practical
requirements for efficiently handling __ptrauth qualified types
mean that you would want
some_addr_discriminated_t[100];
to not be reported as trivially relocatable, while
struct {
...
some_addr_discriminated_t field;
...
}
to be reported as such, and the actual decision would regress
to what proportion of the object being relocated is subject to
such a policy.
Having is_trivially_relocatable change behaviour according to
some hypothetical internal heuristic is clearly a terrible
idea, and so I think for now we should instead simply limit
the application of trivial relocation to address discriminated
data to those fields that outside of the control of developers.1 parent 3ba1e39 commit 6b5de16
File tree
5 files changed
+70
-31
lines changed- clang
- include/clang/AST
- lib
- AST
- Sema
- test/SemaCXX
5 files changed
+70
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
629 | 629 | | |
630 | 630 | | |
631 | 631 | | |
632 | | - | |
| 632 | + | |
633 | 633 | | |
634 | 634 | | |
635 | 635 | | |
636 | 636 | | |
637 | | - | |
638 | | - | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
639 | 642 | | |
640 | | - | |
641 | | - | |
642 | | - | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
643 | 652 | | |
644 | 653 | | |
645 | 654 | | |
646 | 655 | | |
647 | 656 | | |
648 | 657 | | |
649 | 658 | | |
650 | | - | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
651 | 672 | | |
652 | 673 | | |
653 | 674 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1704 | 1704 | | |
1705 | 1705 | | |
1706 | 1706 | | |
| 1707 | + | |
1707 | 1708 | | |
1708 | | - | |
| 1709 | + | |
1709 | 1710 | | |
1710 | | - | |
| 1711 | + | |
1711 | 1712 | | |
1712 | 1713 | | |
1713 | 1714 | | |
| |||
1721 | 1722 | | |
1722 | 1723 | | |
1723 | 1724 | | |
1724 | | - | |
1725 | | - | |
1726 | | - | |
| 1725 | + | |
| 1726 | + | |
1727 | 1727 | | |
1728 | 1728 | | |
1729 | 1729 | | |
1730 | | - | |
| 1730 | + | |
1731 | 1731 | | |
1732 | 1732 | | |
1733 | | - | |
| 1733 | + | |
1734 | 1734 | | |
1735 | 1735 | | |
1736 | 1736 | | |
1737 | 1737 | | |
1738 | 1738 | | |
1739 | | - | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
1740 | 1742 | | |
1741 | 1743 | | |
1742 | 1744 | | |
1743 | 1745 | | |
1744 | 1746 | | |
1745 | 1747 | | |
1746 | 1748 | | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
1747 | 1756 | | |
1748 | | - | |
1749 | | - | |
1750 | | - | |
| 1757 | + | |
| 1758 | + | |
1751 | 1759 | | |
1752 | | - | |
1753 | | - | |
| 1760 | + | |
| 1761 | + | |
1754 | 1762 | | |
1755 | 1763 | | |
1756 | 1764 | | |
1757 | | - | |
1758 | | - | |
| 1765 | + | |
| 1766 | + | |
1759 | 1767 | | |
1760 | | - | |
| 1768 | + | |
1761 | 1769 | | |
1762 | 1770 | | |
1763 | 1771 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
334 | 337 | | |
335 | 338 | | |
336 | 339 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
33 | 40 | | |
34 | 41 | | |
35 | 42 | | |
| |||
0 commit comments