Re: [PATCH] Add reference binding instrumentation

2013-12-04 Thread Jason Merrill
On 12/03/2013 02:45 PM, Marek Polacek wrote: You're right. I wanted to use cp_save_expr and/or stabilize_expr, but that didn't work out. So I resorted to restrict the condition a bit and only pass INDIRECT_REFs to the ubsan routine (which, after all, has if (!INDIRECT_REF_P (init)) retu

Re: [PATCH] Add reference binding instrumentation

2013-12-03 Thread Marek Polacek
On Tue, Nov 19, 2013 at 10:07:00AM -0500, Jason Merrill wrote: > On 11/18/2013 11:39 AM, Marek Polacek wrote: > >+init = fold_build2 (COMPOUND_EXPR, TREE_TYPE (init), > >+ubsan_instrument_reference (input_location, init), > >+init); > > This look

Re: [PATCH] Add reference binding instrumentation

2013-11-19 Thread Jason Merrill
On 11/18/2013 11:39 AM, Marek Polacek wrote: + init = fold_build2 (COMPOUND_EXPR, TREE_TYPE (init), + ubsan_instrument_reference (input_location, init), + init); This looks like it will evaluate init twice. Jason