Re: [PING] Re: [PATCH] c++/67913, 67917 - fix new expression with wrong number of elements

2015-11-26 Thread Martin Sebor
On 11/26/2015 10:45 AM, Martin Sebor wrote: On 11/26/2015 04:33 AM, Ramana Radhakrishnan wrote: Cookies on ARM are 8-bytes [1], but sizeof ((size_t) n) is only 4-bytes, so this check will fail (We'll ask for 500 bytes, the test here will only be looking for 496). Would it undermine the test

Re: [PING] Re: [PATCH] c++/67913, 67917 - fix new expression with wrong number of elements

2015-11-26 Thread James Greenhalgh
On Thu, Nov 05, 2015 at 12:30:08PM -0700, Martin Sebor wrote: > On 11/02/2015 09:55 PM, Jason Merrill wrote: > >On 10/26/2015 10:06 PM, Martin Sebor wrote: > >>+ if (TREE_CONSTANT (maybe_constant_value (outer_nelts))) > >>+{ > >>+ if (tree_int_cst_lt (max_outer_nelts_tree,

Re: [PING] Re: [PATCH] c++/67913, 67917 - fix new expression with wrong number of elements

2015-11-26 Thread Ramana Radhakrishnan
> Cookies on ARM are 8-bytes [1], but sizeof ((size_t) n) is only 4-bytes, > so this check will fail (We'll ask for 500 bytes, the test here will only > be looking for 496). > > Would it undermine the test for other architectures if I were to swap out > the != for a >= ? I think that is in line

Re: [PING] Re: [PATCH] c++/67913, 67917 - fix new expression with wrong number of elements

2015-11-26 Thread Martin Sebor
On 11/26/2015 04:33 AM, Ramana Radhakrishnan wrote: Cookies on ARM are 8-bytes [1], but sizeof ((size_t) n) is only 4-bytes, so this check will fail (We'll ask for 500 bytes, the test here will only be looking for 496). Would it undermine the test for other architectures if I were to swap out

Re: [PING] Re: [PATCH] c++/67913, 67917 - fix new expression with wrong number of elements

2015-11-06 Thread Jason Merrill
OK. Jason

Re: [PING] Re: [PATCH] c++/67913, 67917 - fix new expression with wrong number of elements

2015-11-05 Thread Martin Sebor
On 11/02/2015 09:55 PM, Jason Merrill wrote: On 10/26/2015 10:06 PM, Martin Sebor wrote: + if (TREE_CONSTANT (maybe_constant_value (outer_nelts))) +{ + if (tree_int_cst_lt (max_outer_nelts_tree, outer_nelts)) maybe_constant_value may return a constant, but that doesn't mean that

Re: [PING] Re: [PATCH] c++/67913, 67917 - fix new expression with wrong number of elements

2015-11-02 Thread Jason Merrill
On 10/26/2015 10:06 PM, Martin Sebor wrote: + if (TREE_CONSTANT (maybe_constant_value (outer_nelts))) + { + if (tree_int_cst_lt (max_outer_nelts_tree, outer_nelts)) maybe_constant_value may return a constant, but that doesn't mean that outer_nelts was already constant; if

[PING] Re: [PATCH] c++/67913, 67917 - fix new expression with wrong number of elements

2015-10-26 Thread Martin Sebor
[CC Jason] The patch is at the link below: https://gcc.gnu.org/ml/gcc-patches/2015-10/msg01803.html Thanks On 10/19/2015 12:50 PM, Martin Sebor wrote: This is a patch for two C++ bugs: 67913 - new expression with negative size not diagnosed 67927 - array new expression with excessive

[PATCH] c++/67913, 67917 - fix new expression with wrong number of elements

2015-10-19 Thread Martin Sebor
This is a patch for two C++ bugs: 67913 - new expression with negative size not diagnosed 67927 - array new expression with excessive number of elements not diagnosed The C++ front end rejects a subset of array declarators with negative bounds or with bounds in excess of some