[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

Balázs Kéri via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 8 06:23:18 PST 2024


================
@@ -234,6 +235,9 @@ class StreamChecker : public Checker<check::PreCall, eval::Call,
   BugType BT_StreamEof{this, "Stream already in EOF", "Stream handling error"};
   BugType BT_ResourceLeak{this, "Resource leak", "Stream handling error",
                           /*SuppressOnSink =*/true};
+  BugType BT_SizeNull{this, "NULL size pointer", "Stream handling error"};
+  BugType BT_SizeNotZero{this, "NULL line pointer and size not zero",
----------------
balazske wrote:

I do not like that there is a separate bug type for all kinds of NULL pointers (NULL stream, NULL "size pointer", NULL "line pointer". One common NULL pointer bug type can be enough (probably another for NULL stream). And these new bug types are not really "stream handling errors".

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


More information about the cfe-commits mailing list