[PATCH] D53069: [analyzer][www] Update avaible_checks.html

Reka Kovacs via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 10 04:40:45 PDT 2018


rnkovacs added inline comments.


================
Comment at: www/analyzer/available_checks.html:376-393
+<tr><td><div class="namedescr expandable"><span class="name">
+cplusplus.InnerPointer</span><span class="lang">
+(C++)</span><div class="descr">
+Check for inner pointers of C++ containers used after re/deallocation.
+</div></div></td>
+<td><div class="exampleContainer expandable">
+<div class="example"><pre>
----------------
Szelethus wrote:
> @rnkovacs Is this a good description of your checker?
Hmm, how about:

```
void log(const char *str);

void test(int value) {
  const char *msg = std::to_string(value).c_str();
  // msg points to the buffer of a temporary that is now destroyed
  log(msg);  // warn: inner pointer of container used after re/deallocation
}
```

Most of the issues it found in real code looked like this.
Thanks a lot!


https://reviews.llvm.org/D53069





More information about the cfe-commits mailing list