New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[clang][StaticAnalyzer] Crash on loop unrolling mode #68819
Comments
@llvm/issue-subscribers-clang-static-analyzer Author: Ding Fei (danix800)
```c
// test.c
// unroll-loops=true
void test_escaping_on_var_before_switch_case_no_crash(int c) {
|
@llvm/issue-subscribers-good-first-issue Author: Ding Fei (danix800)
```c
// test.c
// unroll-loops=true
void test_escaping_on_var_before_switch_case_no_crash(int c) {
|
@danix800 please could you give some information on how to reproduce this as I am not sure how to test the issue thanks |
Remember to use a build with assertions. I added a godbolt link to the summary, that will exercise this crash. |
@steakhal // A loop counter is considered escaped if:
// case 1: It is a global variable.
// case 2: It is a reference parameter or a reference capture.
// case 3: It is assigned to a non-const reference variable or parameter.
// case 4: Has its address taken. Also, what caused the |
@steakhal |
This table makes sense to me.
I'm not sure I understand this. To me, we have this issue about an unsupported feature flag, which is untested and crashing. I don't expect the majority of our users to set this flag, thus it falls out of scope to me, and I won't pursue fixing/investigating this. Of course, I'm here to discuss technical questions on a best-effort basis, so don't hesitate to ask if you have some. |
Hi, can anyone please assigned me this issue? would love to work on this & this would be my first or in llvm |
@ranjanmangla1: Just create pull request and mention it on this page. |
Hi, I am currently working on this. The crash seems to happen because we don't check the |
StaticAnalyzer didn't check if the variable is declared in `CompoundStmt` under `SwitchStmt`, which make static analyzer reach root without finding the declaration. Fixes #68819 --------- Co-authored-by: Balazs Benics <benicsbalazs@gmail.com>
godbolt
crash dump:
The text was updated successfully, but these errors were encountered: