[PATCH] Reject multiplication by zero cases in MallocOverflowSecurityChecker

Anna Zaks zaks.anna at gmail.com
Thu May 14 17:30:49 PDT 2015


Please, submit the patch with context as described on the llvm website.

Could you provide more motivation for this patch?


REPOSITORY
  rL LLVM

================
Comment at: lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp:61
@@ +60,3 @@
+// Return true for redundant computations.
+static bool RedundantComputation(APSInt &Val, BinaryOperatorKind op) {
+  if (op == BO_Mul && Val == 0)
----------------
This is not a redundant computation, a redundant computation would be 1*x.

http://reviews.llvm.org/D9741

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list