History log of /llvm-project/clang/test/Analysis/builtin_overflow_notes.c (Results 1 – 1 of 1)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2
# 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 ...