[clang] [clang][analyzer] Relax assertion for non-default address spaces in the cstring checker (PR #153498)

Isaac Nudelman via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 16 12:28:46 PDT 2025


================
@@ -1129,9 +1129,9 @@ bool CStringChecker::isFirstBufInBound(CheckerContext &C, ProgramStateRef State,
   if (!ER)
     return true; // cf top comment.
 
-  // FIXME: Does this crash when a non-standard definition
-  // of a library function is encountered?
-  assert(ER->getValueType() == C.getASTContext().CharTy &&
+  // Support library functions defined with non-default address spaces
+  assert(ER->getValueType().getCanonicalType().getUnqualifiedType() ==
----------------
nuudlman wrote:

It does, changed to use it now

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


More information about the cfe-commits mailing list