#
a017ed04 |
| 03-Oct-2024 |
Pavel Skripkin <paskripkin@gmail.com> |
[analyzer] Model overflow builtins (#102602)
Add basic support for `builtin_*_overflow` primitives. These helps a lot for checking custom calloc-like functions with inlinable body. Without such s
[analyzer] Model overflow builtins (#102602)
Add basic support for `builtin_*_overflow` primitives. These helps a lot for checking custom calloc-like functions with inlinable body. Without such support code like
```c #include <stddef.h> #include <stdlib.h>
static void *myMalloc(size_t a1, size_t a2) { size_t res;
if (__builtin_mul_overflow(a1, a2, &res)) return NULL; return malloc(res); }
void test(void) { char *ptr = myMalloc(10, 1); ptr[20] = 10; } ````
does not trigger any warnings.
show more ...
|