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

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 24 01:49:31 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Dmitry Chestnykh (chestnykh)

<details>
<summary>Changes</summary>

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

---
Full diff: https://github.com/llvm/llvm-project/pull/100328.diff


1 Files Affected:

- (modified) llvm/lib/Transforms/Instrumentation/NumericalStabilitySanitizer.cpp (+1-1) 


``````````diff
diff --git a/llvm/lib/Transforms/Instrumentation/NumericalStabilitySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/NumericalStabilitySanitizer.cpp
index 0b54f571f5508..1441d74cbf646 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");
+    assert(0 && !"Unexpected value of sized functions arguments");
   }
 
   for (size_t i = 0; i < NumSizedFuncs; ++i)

``````````

</details>


https://github.com/llvm/llvm-project/pull/100328


More information about the llvm-commits mailing list