[clang] [StaticAnalyzer] Fix state update in VisitObjCForCollectionStmt (PR #124477)

Ziqing Luo via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 26 12:16:06 PST 2025


ziqingluo-90 wrote:

Unfortunately, I cannot forge a minimal example to reproduce this bug due to the aforementioned fact that `evalLocation` alters the state very rarely.

A minimal example would be just execute an objective-c for loop like this:
```
for (T * element in collection) {

}
```
Then if `evalLocation` for `&element` alters the state, we will have a minimal reproducer.   The `evalLocation` alters the state by running a set of checkers that check if `&element != nil`,  which is always `true`.    Some checkers then assume `true` on the state which may result in a new state.  I'm not familiar with those checkers enough to create such a state :(   

I would greatly appreciate if anyone can help me create a minimal reproducer.

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


More information about the cfe-commits mailing list