On Fri, Apr 07, 2017 at 07:23:17PM +0200, Marek Polacek wrote:
> This ICEs in ubsan_instrument_division on the assert that checks whether both
> operands of the division have the same type.  Well, here they didn't, because
> in cp_build_binary_op we first converted both operands to result_type but then
> fold_non_dependent_expr changed the type of op0, so we need to catch this case
> before calling ubsan_instrument_division.
> 
> Bootstrapped/regtested on x86_64-linux, ok for trunk?
> 
> 2017-04-07  Marek Polacek  <pola...@redhat.com>
> 
>       PR sanitizer/80348
>       * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
> 
>       * g++.dg/ubsan/div-by-zero-2.C: New test.

Ok, thanks.

        Jakub

Reply via email to