This is the mail archive of the
mailing list for the GCC project.
Re: Bounds checking for TREE_VEC_ELT and related bugs (PR c++/8511)
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- Cc: Graham Stott <graham dot stott at btinternet dot com>, Zack Weinberg <zack at codesourcery dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 14 Nov 2002 14:12:51 -0800
- Subject: Re: Bounds checking for TREE_VEC_ELT and related bugs (PR c++/8511)
--On Thursday, November 14, 2002 11:10:52 PM +0100 Gabriel Dos Reis
Mark Mitchell <firstname.lastname@example.org> writes:
| People may do "one past the end" tricks with TREE_VECs, just as they do
| with C arrays; we can decide if we like that or not. If nobody does it
| now, except for that one C++ case, we can say that it's not allowed.
I would strongly lean toward not allowing it. If we want to get the
address the of one-past-the-end then, I think, a canonical way to do
it is array + length, or in this particular case
&TREE_VEC_LENGTH (array) + length
I agree; that's better.
OK, let's definitively not allow TREE_VEC_ELT with an index that doesn't
Mark Mitchell email@example.com
CodeSourcery, LLC http://www.codesourcery.com