Commit 2ae6dac
committed
SIL: Fix subclass scope calculation for constructors
The logic here was buggy; we would dyn_cast the decl to a FuncDecl and
return early if the cast failed; the ConstructorDecl logic had no
effect at all.
Furthermore, it was wrong, for two reasons:
- even non-required designated inits still appear in the vtable
- in the resilient case, the constructor needs public linkage unlike
other non-final public methods, since it is referenced directly
by subclasses when they perform a super.init() delegation
Fixes <https://bugs.swift.org/browse/SR-9939>, <rdar://problem/48403349>.1 parent fa148d2 commit 2ae6dac
File tree
3 files changed
+32
-13
lines changed- lib/SIL
- test/IRGen
- Inputs
3 files changed
+32
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
944 | 944 | | |
945 | 945 | | |
946 | 946 | | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
947 | 952 | | |
948 | 953 | | |
949 | 954 | | |
950 | 955 | | |
951 | | - | |
952 | | - | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
953 | 959 | | |
954 | | - | |
955 | | - | |
956 | | - | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
957 | 965 | | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
958 | 969 | | |
959 | | - | |
| 970 | + | |
960 | 971 | | |
961 | | - | |
| 972 | + | |
962 | 973 | | |
963 | 974 | | |
964 | 975 | | |
965 | 976 | | |
966 | 977 | | |
967 | 978 | | |
968 | 979 | | |
969 | | - | |
| 980 | + | |
970 | 981 | | |
971 | 982 | | |
972 | 983 | | |
| 984 | + | |
973 | 985 | | |
974 | 986 | | |
975 | 987 | | |
976 | 988 | | |
977 | | - | |
| 989 | + | |
978 | 990 | | |
979 | 991 | | |
980 | | - | |
| 992 | + | |
981 | 993 | | |
982 | 994 | | |
983 | 995 | | |
984 | 996 | | |
985 | 997 | | |
986 | | - | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
987 | 1001 | | |
| 1002 | + | |
988 | 1003 | | |
989 | 1004 | | |
990 | 1005 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
0 commit comments