Skip to content

[asan] Flush stderr in test #114084

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion compiler-rt/test/asan/TestCases/Posix/ignore_free_hook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@ bool ignore_free = false;

extern "C" {
WEAK_ON_APPLE void __sanitizer_free_hook(const volatile void *ptr) {
if (ptr == glob_ptr)
if (ptr == glob_ptr) {
fprintf(stderr, "Free Hook\n");
fflush(stderr);
}
}

WEAK_ON_APPLE int __sanitizer_ignore_free_hook(const volatile void *ptr) {
if (ptr != glob_ptr)
return 0;
fprintf(stderr, ignore_free ? "Free Ignored\n" : "Free Respected\n");
fflush(stderr);
return ignore_free;
}
} // extern "C"
Expand Down
Loading