Commit e93ea1d
committed
[SILGen] Fix load ownership for trivial tuple elements in consuming switch
In consuming switch when emitting case block that destructures a tuple payload,
it was unconditionally issuing load [take] even if the element was a trivial type.
Later code assumes loads for trivial types have trivial ownership.
The fix uses TypeLowering::emitLoad() instead of directly creating the
load, which handles setting ownership to trivial if the type is trivial.
Fixes #857431 parent a69dbb3 commit e93ea1d
File tree
2 files changed
+26
-1
lines changed- lib/SILGen
- test/SILGen
2 files changed
+26
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2672 | 2672 | | |
2673 | 2673 | | |
2674 | 2674 | | |
2675 | | - | |
| 2675 | + | |
| 2676 | + | |
| 2677 | + | |
2676 | 2678 | | |
2677 | 2679 | | |
2678 | 2680 | | |
| |||
| 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 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
0 commit comments