Skip to content

Commit c56e799

Browse files
authored
Merge pull request #30523 from CodaFi/stringendo
2 parents 725fe68 + 5524124 commit c56e799

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lib/Frontend/DependencyVerifier.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,9 @@ bool DependencyVerifier::constructObligations(const SourceFile *SF,
446446
return;
447447
case NodeKind::potentialMember: {
448448
auto key = copyDemangledTypeName(Ctx, context);
449+
auto nameCpy = Ctx.AllocateCopy(name);
449450
Obligations.insert({Obligation::Key::forPotentialMember(key),
450-
{name, Expectation::Kind::PotentialMember,
451+
{nameCpy, Expectation::Kind::PotentialMember,
451452
isCascadingUse ? Expectation::Scope::Cascading
452453
: Expectation::Scope::Private}});
453454
}
@@ -463,18 +464,21 @@ bool DependencyVerifier::constructObligations(const SourceFile *SF,
463464
break;
464465
case NodeKind::dynamicLookup: {
465466
auto contextCpy = Ctx.AllocateCopy(context);
466-
Obligations.insert({Obligation::Key::forDynamicMember(name),
467+
auto key = Ctx.AllocateCopy(name);
468+
Obligations.insert({Obligation::Key::forDynamicMember(key),
467469
{contextCpy, Expectation::Kind::DynamicMember,
468470
isCascadingUse ? Expectation::Scope::Cascading
469471
: Expectation::Scope::Private}});
470472
break;
471473
}
472474
case NodeKind::topLevel:
473-
case NodeKind::sourceFileProvide:
474-
Obligations.insert({Obligation::Key::forProvides(name),
475-
{name, Expectation::Kind::Provides,
475+
case NodeKind::sourceFileProvide: {
476+
auto key = Ctx.AllocateCopy(name);
477+
Obligations.insert({Obligation::Key::forProvides(key),
478+
{key, Expectation::Kind::Provides,
476479
Expectation::Scope::None}});
477480
break;
481+
}
478482
case NodeKind::kindCount:
479483
llvm_unreachable("Given count node?");
480484
}

0 commit comments

Comments
 (0)