This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bounds checking for TREE_VEC_ELT and related bugs (PR c++/8511)


Zack Weinberg <zack@codesourcery.com> writes:

[...]

| If you look closely at the code, you will see that the bug is
| harmless: we loop from &TREE_VEC_ELT (method_vec, 2) to TREE_VEC_END
| (method_vec).  If there are only two methods, those pointers will be
| equal and setup_class_bindings won't be called.  We do dereference the
| pointer one past the end of the memory block, but that's easily
| corrected by swapping the tests in the loop exit condition.
| 
| I still consider it a bug.

Got the point of the failure.  Now, I need to have a break :-)
Thanks!

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]