schittir added inline comments.

================
Comment at: clang/lib/Parse/ParseStmt.cpp:886-887
         TopLevelCase = Case;
-      else
+      else {
+        assert(DeepestParsedCaseStmt && "DeepestParsedCaseStmt cannot be 
null");
         Actions.ActOnCaseStmtBody(DeepestParsedCaseStmt, Case.get());
----------------
aaron.ballman wrote:
> The `assert` doesn't add much value, this seems to be a false positive in the 
> analysis.
> 
> If we have no top-level case statement yet, then we get into the `if` branch 
> on line 884, but that then sets `DeepestParsedCaseStmt` on line 890, and that 
> must be non-null because we verified that `Case` is valid above on line 876. 
> So by the time we get into the `else` branch, `DeepestParsedCaseStmt` must be 
> nonnull.
> 
> I don't think changes are needed here at all; WDYT?
This makes sense. I didn't thoroughly consider the Case.isInvalid() check above 
in my analysis. Thank you for catching this! I removed this change. 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153236/new/

https://reviews.llvm.org/D153236

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to