PR c/89495
* c-format.c (maybe_read_dollar_number): Compute nargnum in
HOST_WIDE_INT type to avoid overflows and change overflow_flag
checking.
From-SVN: r269198
+2019-02-25 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/89495
+ * c-format.c (maybe_read_dollar_number): Compute nargnum in
+ HOST_WIDE_INT type to avoid overflows and change overflow_flag
+ checking.
+
2019-02-22 Richard Biener <rguenther@suse.de>
* c-pch.c (no_checksum): Remove.
overflow_flag = 0;
while (ISDIGIT (*fcp))
{
- int nargnum;
- nargnum = 10 * argnum + (*fcp - '0');
- if (nargnum < 0 || nargnum / 10 != argnum)
+ HOST_WIDE_INT nargnum
+ = HOST_WIDE_INT_UC (10) * argnum + (*fcp - '0');
+ if ((int) nargnum != nargnum)
overflow_flag = 1;
argnum = nargnum;
fcp++;