Commit 1e2992f
committed
SIL: Pick default ARC convention for enum case witness thunks based on the kind of the original decl.
Enum constructors take their arguments +1 by default, but they can now be used to satisfy protocol static member
requirements, which take arguments +0 by default. Type lowering would accidentally use the kind of the witness
to determine the conventions for the witness thunk, leading to a miscompile when the requirement is called through
the protocol. This differs from the fix on main in that the behavior change is contained to only cases where the
witness is an enum constructor, to minimize behavior change. rdar://738550521 parent 6e52b9a commit 1e2992f
File tree
2 files changed
+31
-1
lines changed- lib/SIL/IR
- test/SILGen
2 files changed
+31
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2485 | 2485 | | |
2486 | 2486 | | |
2487 | 2487 | | |
2488 | | - | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
| 2491 | + | |
| 2492 | + | |
| 2493 | + | |
| 2494 | + | |
| 2495 | + | |
| 2496 | + | |
| 2497 | + | |
| 2498 | + | |
| 2499 | + | |
| 2500 | + | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
2489 | 2504 | | |
2490 | 2505 | | |
2491 | 2506 | | |
| |||
| 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 | + | |
0 commit comments