Skip to content

Sanitize #14510

@LilTimithywidDahSemi

Description

@LilTimithywidDahSemi

#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
}

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions