Skip to content

Commit fb993bf

Browse files
committed
Fix LifetimeDependence printing
1 parent d598d04 commit fb993bf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/Sema/LifetimeDependence.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ std::string LifetimeDependenceInfo::getString() const {
3535
}
3636
return result;
3737
};
38-
if (!inheritLifetimeParamIndices->isEmpty()) {
38+
if (inheritLifetimeParamIndices && !inheritLifetimeParamIndices->isEmpty()) {
3939
lifetimeDependenceString =
4040
"_inherit(" + getOnIndices(inheritLifetimeParamIndices) + ")";
4141
}
42-
if (!borrowLifetimeParamIndices->isEmpty()) {
42+
if (borrowLifetimeParamIndices && !borrowLifetimeParamIndices->isEmpty()) {
4343
lifetimeDependenceString +=
4444
"_borrow(" + getOnIndices(borrowLifetimeParamIndices) + ")";
4545
}
46-
if (!mutateLifetimeParamIndices->isEmpty()) {
46+
if (mutateLifetimeParamIndices && !mutateLifetimeParamIndices->isEmpty()) {
4747
lifetimeDependenceString +=
4848
"_mutate(" + getOnIndices(mutateLifetimeParamIndices) + ")";
4949
}

0 commit comments

Comments
 (0)