File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -3058,6 +3058,10 @@ void SubstGenericParametersFromMetadata::setup() const {
3058
3058
MetadataOrPack
3059
3059
SubstGenericParametersFromMetadata::getMetadata (
3060
3060
unsigned depth, unsigned index) const {
3061
+ // Don't attempt anything if we have no generic parameters.
3062
+ if (genericArgs == nullptr )
3063
+ return MetadataOrPack ();
3064
+
3061
3065
// On first access, compute the descriptor path.
3062
3066
setup ();
3063
3067
@@ -3099,6 +3103,10 @@ SubstGenericParametersFromMetadata::getMetadata(
3099
3103
const WitnessTable *
3100
3104
SubstGenericParametersFromMetadata::getWitnessTable (const Metadata *type,
3101
3105
unsigned index) const {
3106
+ // Don't attempt anything if we have no generic parameters.
3107
+ if (genericArgs == nullptr )
3108
+ return nullptr ;
3109
+
3102
3110
// On first access, compute the descriptor path.
3103
3111
setup ();
3104
3112
You can’t perform that action at this time.
0 commit comments