Commit 8187ce5
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 7fde0a1 commit 8187ce5
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 | |
|---|---|---|---|
| |||
892 | 892 | | |
893 | 893 | | |
894 | 894 | | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
895 | 900 | | |
896 | 901 | | |
897 | 902 | | |
898 | 903 | | |
899 | | - | |
900 | | - | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
901 | 907 | | |
902 | | - | |
903 | | - | |
904 | | - | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
905 | 913 | | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
906 | 917 | | |
907 | | - | |
| 918 | + | |
908 | 919 | | |
909 | | - | |
| 920 | + | |
910 | 921 | | |
911 | 922 | | |
912 | 923 | | |
913 | 924 | | |
914 | 925 | | |
915 | 926 | | |
916 | 927 | | |
917 | | - | |
| 928 | + | |
918 | 929 | | |
919 | 930 | | |
920 | 931 | | |
| 932 | + | |
921 | 933 | | |
922 | 934 | | |
923 | 935 | | |
924 | 936 | | |
925 | | - | |
| 937 | + | |
926 | 938 | | |
927 | 939 | | |
928 | | - | |
| 940 | + | |
929 | 941 | | |
930 | 942 | | |
931 | 943 | | |
932 | 944 | | |
933 | 945 | | |
934 | | - | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
935 | 949 | | |
| 950 | + | |
936 | 951 | | |
937 | 952 | | |
938 | 953 | | |
| |||
| 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