[asan] fix bug 14277 (asan needs to fail with fata error if an __asan interface funct...
authorKostya Serebryany <kcc@google.com>
Wed, 7 Nov 2012 12:42:18 +0000 (12:42 +0000)
committerKostya Serebryany <kcc@google.com>
Wed, 7 Nov 2012 12:42:18 +0000 (12:42 +0000)
llvm-svn: 167529

llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp

index 93f785c..b7be462 100644 (file)
@@ -731,8 +731,9 @@ bool AddressSanitizer::doInitialization(Module &M) {
       std::string FunctionName = std::string(kAsanReportErrorTemplate) +
           (AccessIsWrite ? "store" : "load") + itostr(1 << AccessSizeIndex);
       // If we are merging crash callbacks, they have two parameters.
-      AsanErrorCallback[AccessIsWrite][AccessSizeIndex] = cast<Function>(
-          M.getOrInsertFunction(FunctionName, IRB.getVoidTy(), IntptrTy, NULL));
+      AsanErrorCallback[AccessIsWrite][AccessSizeIndex] =
+          checkInterfaceFunction(M.getOrInsertFunction(
+              FunctionName, IRB.getVoidTy(), IntptrTy, NULL));
     }
   }