[asan] relax the assertion around array cookie load; still need to extract a reproducer where this assertion fails...

llvm-svn: 217215
This commit is contained in:
Kostya Serebryany 2014-09-05 01:16:30 +00:00
parent 30a6bc286b
commit 1fb81720ec
1 changed files with 8 additions and 4 deletions

View File

@ -246,10 +246,14 @@ uptr __asan_load_cxx_array_cookie(uptr *p) {
// which means that we are going to get double-free. So, return 0 to avoid
// infinite loop of destructors. We don't want to report a double-free here
// though, so print a warning just in case.
CHECK_EQ(sval, kAsanHeapFreeMagic);
Report("AddressSanitizer: loaded array cookie from free-d memory; "
"expect a double-free report\n");
return 0;
// CHECK_EQ(sval, kAsanHeapFreeMagic);
if (sval == kAsanHeapFreeMagic) {
Report("AddressSanitizer: loaded array cookie from free-d memory; "
"expect a double-free report\n");
return 0;
}
// FIXME: apparently it can be something else; need to find a reproducer.
return *p;
}
// This is a simplified version of __asan_(un)poison_memory_region, which