This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36633] warning "array subscript is below array bounds" on delete [] with -O2, -Wall
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Jun 2008 20:59:51 -0000
- Subject: [Bug c++/36633] warning "array subscript is below array bounds" on delete [] with -O2, -Wall
- References: <bug-36633-14909@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from pinskia at gcc dot gnu dot org 2008-06-25 20:59 -------
D.2148_2 = (struct D[7] *) D.2168_1;
D.2149_3 = D.2148_2 + 8;
D.2169_4 = (long unsigned int *) D.2149_3;
D.2170_5 = D.2169_4 + -8;
That seems wrong. Why are we going from a struct D[7] * to a long unsigned int
* ?
In fact I think this is a bug in the C++ front-end really. It is producing
weird types with respect of operator new[] in the first place. the first 8
bytes is the size but casts the resulting of operator new first to struct D[7]
* and then does an add, that seems wrong.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|middle-end |c++
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36633