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

via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 26 08:20:40 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff d0b1fec9e1510d01dad2c9c429573eaa75f0963c 5e62483adf6620d481bdb873dd91f81b8a95f6fc -- clang/test/Analysis/getline-stream.c clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp clang/lib/StaticAnalyzer/Core/CheckerHelpers.cpp clang/test/Analysis/Inputs/system-header-simulator-for-malloc.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
index b4b828784c..f83d4e436d 100644
--- a/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
@@ -1209,7 +1209,7 @@ void StreamChecker::preGetdelim(const FnDescription *Desc,
   // If lineptr points to a NULL pointer, *n must be 0
   State =
       ensureSizeZeroIfLineNull(LinePtrPtrSVal, SizePtrSval, Call.getArgExpr(0),
-                                Call.getArgExpr(1), C, State);
+                               Call.getArgExpr(1), C, State);
   if (!State)
     return;
 

``````````

</details>


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


More information about the cfe-commits mailing list