public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/56582] New: ICE on negative array index in C++11 constant expression evaluation
@ 2013-03-09 20:51 richard-gccbugzilla at metafoo dot co.uk
  2013-03-09 22:41 ` [Bug c++/56582] " paolo.carlini at oracle dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: richard-gccbugzilla at metafoo dot co.uk @ 2013-03-09 20:51 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56582

             Bug #: 56582
           Summary: ICE on negative array index in C++11 constant
                    expression evaluation
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: richard-gccbugzilla@metafoo.co.uk


The C++ expression evaluator is not checking for negative array indices when
indexing string literals. This leads to ICEs and reading arbitrary memory
within the GCC process:

// Reliable ICE
constexpr int n[3] = {}; constexpr int k = n[-1];

// Some random byte
constexpr char c = "foo"[-1000];


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

end of thread, other threads:[~2013-03-23  1:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-09 20:51 [Bug c++/56582] New: ICE on negative array index in C++11 constant expression evaluation richard-gccbugzilla at metafoo dot co.uk
2013-03-09 22:41 ` [Bug c++/56582] " paolo.carlini at oracle dot com
2013-03-09 23:07 ` paolo.carlini at oracle dot com
2013-03-16 10:02 ` paolo at gcc dot gnu.org
2013-03-16 10:04 ` paolo.carlini at oracle dot com
2013-03-23  1:25 ` paolo.carlini at oracle dot com

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).