Skip to content

Commit 2b18e5d

Browse files
committed
fix merge conflicts
1 parent 96a2308 commit 2b18e5d

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

clang/lib/Analysis/LifetimeSafety/Facts.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,12 @@ void OriginFlowFact::dump(llvm::raw_ostream &OS, const LoanManager &,
4444
}
4545

4646
void OriginEscapesFact::dump(llvm::raw_ostream &OS, const LoanManager &,
47-
const OriginManager &OM) const {
47+
const OriginManager &OM) const {
4848
OS << "OriginEscapes (";
4949
OM.dump(getEscapedOriginID(), OS);
5050
OS << ")\n";
5151
}
5252

53-
5453
void UseFact::dump(llvm::raw_ostream &OS, const LoanManager &,
5554
const OriginManager &OM) const {
5655
OS << "Use (";
@@ -98,11 +97,10 @@ void FactManager::dump(const CFG &Cfg, AnalysisDeclContext &AC) const {
9897

9998
llvm::ArrayRef<const Fact *>
10099
FactManager::getBlockContaining(ProgramPoint P) const {
101-
for (const auto &Entry : BlockToFactsMap) {
102-
const auto &Facts = Entry.second;
103-
for (const Fact *F : Facts)
100+
for (const auto &BlockToFactsVec : BlockToFacts) {
101+
for (const Fact *F : BlockToFactsVec)
104102
if (F == P)
105-
return Facts;
103+
return BlockToFactsVec;
106104
}
107105
return {};
108106
}

clang/lib/Analysis/LifetimeSafety/LoanPropagation.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,11 @@ static llvm::BitVector computePersistentOrigins(const FactManager &FactMgr,
5858
CheckOrigin(OF->getSrcOriginID());
5959
break;
6060
}
61-
case Fact::Kind::ReturnOfOrigin:
62-
CheckOrigin(F->getAs<ReturnOfOriginFact>()->getReturnedOriginID());
63-
break;
6461
case Fact::Kind::Use:
6562
CheckOrigin(F->getAs<UseFact>()->getUsedOrigin());
6663
break;
64+
case Fact::Kind::OriginEscapes:
65+
break;
6766
case Fact::Kind::Expire:
6867
case Fact::Kind::TestPoint:
6968
break;

clang/test/Sema/warn-lifetime-safety.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,8 @@ View lifetimebound_return_of_by_value_param(MyObj stack_param) {
736736
// FIXME: Fails to diagnose UAF when a reference to a by-value param escapes via an out-param.
737737
void uaf_from_by_value_param_failing(MyObj param, View* out_p) {
738738
*out_p = Identity(param);
739-
739+
}
740+
740741
// Conditional operator.
741742
void conditional_operator_one_unsafe_branch(bool cond) {
742743
MyObj safe;

0 commit comments

Comments
 (0)