Skip to content

Commit 1cb92a2

Browse files
committed
operator_array_new_with_dtor_left_oob: turn opt back on
unlike __attribute__((optnone)) MSVC's #pragma optimize("", off) needs to be turned back on
1 parent 550adc9 commit 1cb92a2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler-rt/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ struct C {
1313
__attribute__((optnone))
1414
#endif
1515
int ATTRIBUTE_NOINLINE hide(int x) { return x; }
16-
16+
#if defined(_MSC_VER) && !defined(__clang__)
17+
#pragma optimize("", on)
18+
#endif
1719
int main() {
1820
C *buffer = new C[42];
1921
buffer[hide(-(1 + (int)sizeof(void*) / 4))].x = 42;

0 commit comments

Comments
 (0)