Szelethus added inline comments.

================
Comment at: 
clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:229-234
     BufferSizeConstraint(ArgNo BufArgN, ArgNo SizeArgN)
         : ValueConstraint(BufArgN), SizeArgN(SizeArgN) {}
 
+    BufferSizeConstraint(ArgNo BufArgN, ArgNo SizeArgN, ArgNo SizeMulArgN)
+        : ValueConstraint(BufArgN), SizeArgN(SizeArgN),
+          SizeMultiplierArgN(SizeMulArgN) {}
----------------
I don't know, these constructors don't look overly talkative.


================
Comment at: 
clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:1041
+                           EvalCallAsPure)
+                       .ArgConstraint(BufferSize(0, 1, 2))}},
     };
----------------
So this is supposed to mean that the 1st argument has the size of the argument 
of 2nd argument times the 3rd argument? Unlike the other summaries, this feels 
a bit cryptic. Something like this might look better:
```lang=c++
.ArgConstraint(0, BufferSize(/*BufSize*/1, /*BufSizeMultiplier*/))
.ArgConstraint(BufferSize(/*Buffer*/0, /*BufSize*/1, /*BufSizeMultiplier*/2))
.ArgConstraint(0, BufferSizeMul(1, 2))
```
WDYT?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77148/new/

https://reviews.llvm.org/D77148



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to