-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Sanitize #14510
Copy link
Copy link
Open
Labels
Language Servicemore info neededThe issue report is not actionable in its current stateThe issue report is not actionable in its current state
Metadata
Metadata
Assignees
Labels
Language Servicemore info neededThe issue report is not actionable in its current stateThe issue report is not actionable in its current state
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
StatusShow more project fields
No status
#ifdef SANITIZE_ADDRESS
// no_sanitize_address is only defined when compiling with MSVC AddressSanitizer.
// Guard against this by checking if
__SANITIZE_ADDRESS__is defined.#define NO_SANITIZE_ADDRESS __declspec(no_sanitize_address)
#else
#define NO_SANITIZE_ADDRESS
#endif
NO_SANITIZE_ADDRESS
void test1()
{
int x[100];
x[100] = 5; // ASan exception not caught
}
void test2()
{
NO_SANITIZE_ADDRESS int x[100];
x[100] = 5; // ASan exception not caught
}
NO_SANITIZE_ADDRESS int g[100];
void test3()
{
g[100] = 5; // ASan exception not caught
}