@@ -446,8 +446,9 @@ bool DependencyVerifier::constructObligations(const SourceFile *SF,
446
446
return ;
447
447
case NodeKind::potentialMember: {
448
448
auto key = copyDemangledTypeName (Ctx, context);
449
+ auto nameCpy = Ctx.AllocateCopy (name);
449
450
Obligations.insert ({Obligation::Key::forPotentialMember (key),
450
- {name , Expectation::Kind::PotentialMember,
451
+ {nameCpy , Expectation::Kind::PotentialMember,
451
452
isCascadingUse ? Expectation::Scope::Cascading
452
453
: Expectation::Scope::Private}});
453
454
}
@@ -463,18 +464,21 @@ bool DependencyVerifier::constructObligations(const SourceFile *SF,
463
464
break ;
464
465
case NodeKind::dynamicLookup: {
465
466
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),
467
469
{contextCpy, Expectation::Kind::DynamicMember,
468
470
isCascadingUse ? Expectation::Scope::Cascading
469
471
: Expectation::Scope::Private}});
470
472
break ;
471
473
}
472
474
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,
476
479
Expectation::Scope::None}});
477
480
break ;
481
+ }
478
482
case NodeKind::kindCount:
479
483
llvm_unreachable (" Given count node?" );
480
484
}
0 commit comments