-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Description
| Bugzilla Link | 2763 |
| Resolution | FIXED |
| Resolved on | Nov 07, 2018 00:22 |
| Version | unspecified |
| OS | MacOS X |
| Attachments | Contains a single short instance method that produces a false dead store |
| Reporter | LLVM Bugzilla Contributor |
| CC | @tkremenek |
Extended Description
The static analyzer finds dead stores, which it thinks are dead due to a later assignment that can't be reached because the first assignment is always followed by a branch that misses the second. I expect this is a more general problem untangling code paths, but this is a good illustration.
checker-85 (2008-08-28 14:46:11)
Mac OS X 10.5.4
Attached is a small objc method that reproduces a false dead store positive. It's derived from a larger example and probably doesn't make a great deal of sense from a semantic point of view. The gist is that the loop counter "index" is incremented by one or more on each iteration.
I can make this a standalone example if you'd prefer, or you can just drop this code into any Foundation based class implementation you have lying about.