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 {
30583058MetadataOrPack
30593059SubstGenericParametersFromMetadata::getMetadata (
30603060 unsigned depth, unsigned index) const {
3061+ // Don't attempt anything if we have no generic parameters.
3062+ if (genericArgs == nullptr )
3063+ return MetadataOrPack ();
3064+
30613065 // On first access, compute the descriptor path.
30623066 setup ();
30633067
@@ -3099,6 +3103,10 @@ SubstGenericParametersFromMetadata::getMetadata(
30993103const WitnessTable *
31003104SubstGenericParametersFromMetadata::getWitnessTable (const Metadata *type,
31013105 unsigned index) const {
3106+ // Don't attempt anything if we have no generic parameters.
3107+ if (genericArgs == nullptr )
3108+ return nullptr ;
3109+
31023110 // On first access, compute the descriptor path.
31033111 setup ();
31043112
You can’t perform that action at this time.
0 commit comments