Hi Benjanmin,
On Fri, 1 Sept 2023 at 17:45, David Malcolm via Gcc-patches < gcc-patches@gcc.gnu.org> wrote: > On Fri, 2023-09-01 at 16:48 +0200, Benjamin Priour wrote: > > Patch has been updated as per your suggestions and successfully > > regstrapped > > on x86_64-linux-gnu. > > The new testcase placement-new-size.C fails on aarch64: placement-new-size.C:10:3: error: 'int8_t' was not declared in this scope; did you mean 'wint_t'? placement-new-size.C:11:3: error: 'int64_t' was not declared in this scope placement-new-size.C:11:12: error: 'lp' was not declared in this scope placement-new-size.C:11:23: error: 's' was not declared in this scope placement-new-size.C:11:26: error: 'int64_t' does not name a type placement-new-size.C:34:3: error: 'int32_t' was not declared in this scope placement-new-size.C:34:12: error: 'i' was not declared in this scope placement-new-size.C:34:30: error: 'int32_t' does not name a type I suspect you should include <stdint.h> (instead of stdlib.h) Thanks, Christophe > > call_details::maybe_get_arg_region is now > > /* If argument IDX's svalue at the callsite is of pointer type, > > return the region it points to. > > Otherwise return NULL. */ > > > > const region * > > call_details::deref_ptr_arg (unsigned idx) const > > { > > const svalue *ptr_sval = get_arg_svalue (idx); > > return m_model->deref_rvalue (ptr_sval, get_arg_tree (idx), > > m_ctxt); > > } > > > > > > New test is > > > > + > > +void test_binop () > > +{ > > + char *p = (char *) malloc (4); > > + if (!p) > > + return; > > + int32_t *i = ::new (p + 1) int32_t; /* { dg-warning "heap-based > > buffer > > overflow" } */ > > + *i = 42; /* { dg-warning "heap-based buffer overflow" } */ > > + free (p); > > +} > > > > Is it OK for trunk ? > > I didn't resend the whole patch as it otherwise was OK. > > Yes, thanks. > > Dave > >