Commit 51c1fa9
committed
SILGen: Fix assertion failure when emitting foreign-to-native thunk for a method with inout 'self'
We import a C function taking a non-const pointer 'self' parameter
as a mutating method.
The getParameterTypes() helper method in SILGenBridging.cpp would
assert upon encountering the inout 'self' parameter, even though
emitForeignToNativeThunk() would still emit correct code as long
as the 'self' type was not bridged.
Relax the assertion a bit to hopefully still catch bugs where
other parameters are unexpectedly 'inout', but allow it on 'self',
and add a test.
Fixes <rdar://problem/70346482>.1 parent d32a371 commit 51c1fa9
File tree
3 files changed
+38
-6
lines changed- lib/SILGen
- test/SILGen
- Inputs
3 files changed
+38
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
339 | | - | |
| 339 | + | |
| 340 | + | |
340 | 341 | | |
341 | | - | |
342 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
343 | 350 | | |
344 | 351 | | |
345 | 352 | | |
| |||
1723 | 1730 | | |
1724 | 1731 | | |
1725 | 1732 | | |
| 1733 | + | |
1726 | 1734 | | |
1727 | | - | |
| 1735 | + | |
1728 | 1736 | | |
1729 | | - | |
| 1737 | + | |
1730 | 1738 | | |
1731 | 1739 | | |
1732 | 1740 | | |
| |||
1762 | 1770 | | |
1763 | 1771 | | |
1764 | 1772 | | |
1765 | | - | |
| 1773 | + | |
1766 | 1774 | | |
1767 | 1775 | | |
1768 | 1776 | | |
| |||
1787 | 1795 | | |
1788 | 1796 | | |
1789 | 1797 | | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
1790 | 1804 | | |
1791 | 1805 | | |
1792 | 1806 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 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