================
@@ -1533,9 +1533,9 @@ const Stmt *LabelStmt::getInnermostLabeledStmt() const {
}
const Stmt *LoopControlStmt::getNamedLoopOrSwitch() const {
- if (!hasLabelTarget())
- return nullptr;
- return getLabelDecl()->getStmt()->getInnermostLabeledStmt();
+ assert(hasLabelTarget());
+ LabelStmt *Label = getLabelDecl()->getStmt();
+ return Label ? Label->getInnermostLabeledStmt() : nullptr;
----------------
ojhunt wrote:
`std::pair<bool, *>`? (a more general, well out of scope for this PR, option
would be a result type)
https://github.com/llvm/llvm-project/pull/228655
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits