Skip to content

Commit 38a366e

Browse files
committed
Don't test the hooks in sanitizer_common.
These hooks are not implemented for all sanitizers, and so testing is individual for ASan/HWASan.
1 parent 1948e4a commit 38a366e

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

compiler-rt/test/sanitizer_common/TestCases/malloc_hook.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
extern "C" {
1414
const volatile void *global_ptr;
15-
int ignore_free = 0;
1615

1716
#define WRITE(s) write(1, s, sizeof(s))
1817

@@ -28,13 +27,6 @@ void __sanitizer_free_hook(const volatile void *ptr) {
2827
if (__sanitizer_get_ownership(ptr) && ptr == global_ptr)
2928
WRITE("FreeHook\n");
3029
}
31-
int __sanitizer_ignore_free_hook(const volatile void *ptr) {
32-
if (__sanitizer_get_ownership(ptr) && ignore_free) {
33-
WRITE("IgnoreFreeHook\n");
34-
return 1;
35-
}
36-
return 0;
37-
}
3830
} // extern "C"
3931

4032
volatile int *x;
@@ -72,13 +64,6 @@ int main() {
7264

7365
x[0] = 0;
7466
x[127] = -1;
75-
ignore_free = 1;
76-
free((void *)x);
77-
// CHECK: IgnoreFreeHook
78-
79-
// Check that the memory is still valid now and hasn't been poisoned.
80-
x[0] = 99;
81-
ignore_free = 0;
8267
free((void *)x);
8368
// CHECK: FH1
8469
// CHECK: FH2

0 commit comments

Comments
 (0)