-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
[-Wunsafe-buffer-usage] Fix a bug and suppress libc warnings for C fi…
…les (#109496) - Fix a bug in UnsafeBufferUsage.cpp related to casting to PointerType - Suppress -Wunsafe-buffer-usage-in-libc-call for C files (rdar://117182250)
1 parent
19ecded
commit 090dc77
Showing
4 changed files
with
31 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
clang/test/SemaCXX/warn-unsafe-buffer-usage-no-libc-functions-in-c.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// 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}} | ||
} |