This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/80346] pessimistic stringop-overflow
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 06 Apr 2017 20:35:21 +0000
- Subject: [Bug middle-end/80346] pessimistic stringop-overflow
- Auto-submitted: auto-generated
- References: <bug-80346-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80346
--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
The warning for attachment 41147 looks valid. It points to the
g_malloc0_n(__n, __s) call in the else statement in the following block. If
I'm reading it right, there, __s is non-zero, and __n is equal to SIZE_MAX:
do { gint64 __n1 = (tables_nr), __n2 = (0); if (__n1 > __n2) ; else
g_assertion_message_cmpnum (((gchar*) 0), "bug2.c", 59, ((const char*)
(__func__)), "tables_nr" " " ">" " " "0", __n1, ">", __n2, 'i'); } while (0);
tables = (uint32_t *) (__extension__ ({ gsize __n = (gsize) (tables_nr);
gsize __s = sizeof (uint32_t); gpointer __p; if (__s == 1) __p = g_malloc0
(__n); else if (__builtin_constant_p (__n) && (__s == 0 || __n <=
(0x7fffffffffffffffL * 2UL + 1UL)
/ __s)) __p = g_malloc0 (__n * __s); else __p = g_malloc0_n (__n,
__s); __p; }));