[PATCH] D69599: [analyzer] DynamicSize: Remove 'getSizeInElements()' from store

Csaba Dabis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 29 18:43:27 PDT 2019


Charusso added a comment.

The [1] patch which introduced such static element-count data has only one test case in `outofbound.c`:

  void f2() {
    int *p = malloc(12);
    p[3] = 4; // expected-warning{{Access out-of-bound array element (buffer overflow)}}
  }

which probably wanted to be `(int *)malloc(12)`, but in both ways the warning occurs, which is problematic. This is the first step to mitigate that issue.
[1] https://github.com/llvm/llvm-project/commit/228b0d4defb85b2e7acbb642b9f0b5dfc49d3fe7


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69599/new/

https://reviews.llvm.org/D69599





More information about the cfe-commits mailing list