[llvm] cd82fee - [nsan] Fix `Wstring-conversion` error (#100328)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 24 02:35:59 PDT 2024


Author: Dmitry Chestnykh
Date: 2024-07-24T12:35:56+03:00
New Revision: cd82fee3918c4244777310cb97cd02e1ddcbfcf0

URL: https://github.com/llvm/llvm-project/commit/cd82fee3918c4244777310cb97cd02e1ddcbfcf0
DIFF: https://github.com/llvm/llvm-project/commit/cd82fee3918c4244777310cb97cd02e1ddcbfcf0.diff

LOG: [nsan] Fix `Wstring-conversion` error (#100328)

Fix error: implicit conversion turns string literal into bool: 'const
char[46]' to 'bool' [-Werror,-Wstring-conversion]

Added: 
    

Modified: 
    llvm/lib/Transforms/Instrumentation/NumericalStabilitySanitizer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Instrumentation/NumericalStabilitySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/NumericalStabilitySanitizer.cpp
index 0b54f571f5508..b382fedde027b 100644
--- a/llvm/lib/Transforms/Instrumentation/NumericalStabilitySanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/NumericalStabilitySanitizer.cpp
@@ -527,7 +527,7 @@ NsanMemOpFn::NsanMemOpFn(Module &M, ArrayRef<StringRef> Sized,
         M.getOrInsertFunction(Fallback, Attr, VoidTy, PtrTy, IntptrTy));
     SizedFnTy = FunctionType::get(VoidTy, {PtrTy}, false);
   } else {
-    assert(!"Unexpected value of sized functions arguments");
+    llvm_unreachable("Unexpected value of sized functions arguments");
   }
 
   for (size_t i = 0; i < NumSizedFuncs; ++i)


        


More information about the llvm-commits mailing list