[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors

Shafik Yaghmour via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 22 20:44:27 PDT 2023


shafik added inline comments.


================
Comment at: clang/lib/AST/ExprConstant.cpp:4989
     if (SS->getCond()->isValueDependent()) {
       if (!EvaluateDependentExpr(SS->getCond(), Info))
         return ESR_Failed;
----------------
As far as I can tell `Value` will still not be set if we don't return here and we will still crash when we attempt to compare `Value` below:

```
LHS <= Value && Value <= RHS
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153296



More information about the cfe-commits mailing list