[sanitizer] Make sure libmalloc doesn't remove the sanitizer zone from malloc_zones[0]
authorKuba Mracek <mracek@apple.com>
Sun, 11 Dec 2016 08:45:36 +0000 (08:45 +0000)
committerKuba Mracek <mracek@apple.com>
Sun, 11 Dec 2016 08:45:36 +0000 (08:45 +0000)
commit1c002267fb8323491d58630bfd56e79312190dea
tree4a0d03de34e593a69dcef16414598d55b92bc75f
parentb93f78128f5e1a282b159dc9e8cea48297698742
[sanitizer] Make sure libmalloc doesn't remove the sanitizer zone from malloc_zones[0]

In certain OS versions, it was possible that libmalloc replaced the sanitizer zone from being the default zone (i.e. being in malloc_zones[0]). This patch introduces a failsafe that makes sure we always stay the default zone. No testcase for this, because this doesn't reproduce under normal circumstances.

Differential Revision: https://reviews.llvm.org/D27083

llvm-svn: 289376
compiler-rt/lib/sanitizer_common/sanitizer_malloc_mac.inc