[clang] [clang][AST] Fix crash on labeled break/continue within switch condition statement expression (PR #228655)

Ambrose Leeb via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 9 14:01:21 PDT 2026


================
@@ -3109,7 +3109,9 @@ class LoopControlStmt : public Stmt {
   void setLabelDecl(LabelDecl *S) { TargetLabel = S; }
 
   /// If this is a named break/continue, get the loop or switch statement
-  /// that this targets.
+  /// that this targets. May return null if the target LabelStmt has not
+  /// yet been created. Do not call if this is an unnamed break/continue.
----------------
Sirraide wrote:

```suggestion
  /// yet been created. Asserts if this is an unnamed break/continue.
```

https://github.com/llvm/llvm-project/pull/228655


More information about the cfe-commits mailing list