================
@@ -1158,6 +1173,118 @@ void StreamChecker::evalUngetc(const FnDescription 
*Desc, const CallEvent &Call,
   C.addTransition(StateFailed);
 }
 
+ProgramStateRef
+StreamChecker::ensurePtrNotNull(SVal PtrVal, const Expr *PtrExpr,
+                                CheckerContext &C, ProgramStateRef State,
+                                const StringRef PtrDescr) const {
----------------
balazske wrote:

This looks like a generally usable function, for example if buffer in `fread` 
or `fwrite` is checked for null pointer. For this a special bug report for 
"NULL size" does not work, but a generic NULL pointer bug report can work. 
Probably this function can be merged with `ensureStreamNonNull` too.

https://github.com/llvm/llvm-project/pull/83027
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to