public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/62059] New: signed integer overflow in diagnostic.c adjust_line
@ 2014-08-08  8:10 zeccav at gmail dot com
  2014-08-17 16:20 ` [Bug c/62059] " mpolacek at gcc dot gnu.org
  2014-08-17 16:21 ` mpolacek at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: zeccav at gmail dot com @ 2014-08-08  8:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62059

            Bug ID: 62059
           Summary: signed integer overflow in diagnostic.c adjust_line
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zeccav at gmail dot com

Created attachment 33272
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33272&action=edit
Used by test case

// gcc 4.9.1
// ../../gcc-4.9.1/gcc/diagnostic.c:274:42: runtime error: signed integer
overflow: 2147483646 - -4 cannot be represented in type 'int'
// installparse.l is a one line file containing "%{%}" I am attaching it anyway
// offending instruction in diagnostic.c function adjust_line is
// right_margin = max_width - right_margin;
// where max_width==INT_MAX and right_margin is negative (here is -4) 
# 1 "installparse.l"
static foo(void);
void bar(void)
{
 foo();
}

I am attaching installparse.l


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c/62059] signed integer overflow in diagnostic.c adjust_line
  2014-08-08  8:10 [Bug c/62059] New: signed integer overflow in diagnostic.c adjust_line zeccav at gmail dot com
@ 2014-08-17 16:20 ` mpolacek at gcc dot gnu.org
  2014-08-17 16:21 ` mpolacek at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-08-17 16:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62059

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Sun Aug 17 16:19:43 2014
New Revision: 214074

URL: https://gcc.gnu.org/viewcvs?rev=214074&root=gcc&view=rev
Log:
    PR c/62059
    * diagnostic.c (adjust_line): Add gcc_checking_assert.
    (diagnostic_show_locus): Don't print caret diagnostic
    if a column is larger than the line_width.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/diagnostic.c


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c/62059] signed integer overflow in diagnostic.c adjust_line
  2014-08-08  8:10 [Bug c/62059] New: signed integer overflow in diagnostic.c adjust_line zeccav at gmail dot com
  2014-08-17 16:20 ` [Bug c/62059] " mpolacek at gcc dot gnu.org
@ 2014-08-17 16:21 ` mpolacek at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-08-17 16:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62059

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-17 16:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-08  8:10 [Bug c/62059] New: signed integer overflow in diagnostic.c adjust_line zeccav at gmail dot com
2014-08-17 16:20 ` [Bug c/62059] " mpolacek at gcc dot gnu.org
2014-08-17 16:21 ` mpolacek at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).