[clang] [clang][StaticAnalyzer] Crash on loop unrolling mode (PR #82089)

via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 19 05:58:53 PST 2024


huang-me wrote:

> If I understand it correctly, your change doesn't handle declarations that are in inner statements, e.g. the variable "x" in the following code:
> 
> ```c++
> switch (get_value()) {
> case 42:
>   do {
>     int x;
>     // ...
>   } while (running);
> //...
> }
> ```
> 
> Is this compatible with the goals of your commit, or would the original crash remain in a situation like this?

As far as I understand it, the declaration within the `CaseStmt` would be found before reaching `SwitchStmt` so I don't think we need to consider this situation.

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


More information about the cfe-commits mailing list