mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 00:26:43 +00:00

- Fix a bug in UnsafeBufferUsage.cpp related to casting to PointerType - Suppress -Wunsafe-buffer-usage-in-libc-call for C files (rdar://117182250)
11 lines
340 B
C
11 lines
340 B
C
// RUN: %clang_cc1 -Wunsafe-buffer-usage %s -verify %s -x c
|
|
// RUN: %clang_cc1 -Wunsafe-buffer-usage %s -verify %s -x objective-c
|
|
|
|
void* __asan_memcpy(void *dst,const void *src, unsigned long size);
|
|
|
|
void f(int *p, int *q) {
|
|
|
|
__asan_memcpy(p, q, 10); // no libc warn in C
|
|
++p[5]; // expected-warning{{unsafe buffer access}}
|
|
}
|