[asan] Fix Android build for API >= 21.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Mon, 8 Jun 2015 18:15:52 +0000 (18:15 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Mon, 8 Jun 2015 18:15:52 +0000 (18:15 +0000)
/code/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc:971:8: error: address of function 'dl_iterate_phdr' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
  if (!dl_iterate_phdr)
      ~^~~~~~~~~~~~~~~
/code/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc:971:8: note: prefix with the address-of operator to silence this warning
  if (!dl_iterate_phdr)
       ^
       &

llvm-svn: 239321

compiler-rt/lib/sanitizer_common/sanitizer_linux.cc

index 1fffe5f..7ba690e 100644 (file)
@@ -968,7 +968,7 @@ static int dl_iterate_phdr_test_cb(struct dl_phdr_info *info, size_t size,
 static atomic_uint32_t android_api_level;
 
 static u32 AndroidDetectApiLevel() {
-  if (!dl_iterate_phdr)
+  if (!&dl_iterate_phdr)
     return 19; // K or lower
   bool base_name_seen = false;
   dl_iterate_phdr(dl_iterate_phdr_test_cb, &base_name_seen);