diff options
Diffstat (limited to 'compiler-rt/lib/asan/tests/asan_test.cpp')
| -rw-r--r-- | compiler-rt/lib/asan/tests/asan_test.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler-rt/lib/asan/tests/asan_test.cpp b/compiler-rt/lib/asan/tests/asan_test.cpp index 2d054ee859ed..2d23a12cc6ae 100644 --- a/compiler-rt/lib/asan/tests/asan_test.cpp +++ b/compiler-rt/lib/asan/tests/asan_test.cpp @@ -395,7 +395,8 @@ TEST(AddressSanitizer, ReallocTest) { } free(ptr); // Realloc pointer returned by malloc(0). - int *ptr2 = Ident((int*)malloc(0)); + void *ptr0 = malloc(0); + int *ptr2 = Ident((int *)ptr0); ptr2 = Ident((int*)realloc(ptr2, sizeof(*ptr2))); *ptr2 = 42; EXPECT_EQ(42, *ptr2); |
