[PATCH] Ignore report when the argument to malloc is assigned known value

Anna Zaks zaks.anna at gmail.com
Wed Jun 17 22:34:04 PDT 2015


================
Comment at: test/Analysis/malloc-overflow.c:117
@@ +116,3 @@
+{
+  return malloc(n * 0 * sizeof(int));  // no-warning
+}
----------------
What is wrong with the current behavior of f15()?
    ex.c:12:10: warning: Call to 'malloc' has an allocation size of 0 bytes
    return malloc(n * 0 * sizeof(int));  // no-warning

http://reviews.llvm.org/D9924

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






More information about the cfe-commits mailing list