flst / upstream /emscripten /test /core /test_asan_api.c
arudradey's picture
Upload folder using huggingface_hub
00df61d verified
Raw
History Blame Contribute Delete
397 Bytes
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sanitizer/asan_interface.h>
int main() {
char *x = malloc(10);
memset(x, 0, 10);
printf("poisoned: %d\n", __asan_address_is_poisoned(x));
free(x);
printf("poisoned: %d\n", __asan_address_is_poisoned(x));
__asan_unpoison_memory_region(x, 10);
printf("poisoned: %d\n", __asan_address_is_poisoned(x));
return 0;
}