Re: [C++ PATCH] Fix assignment to lvalue COND_EXPR vs. ubsan (PR sanitizer/89869)

2019-03-29 Thread Jason Merrill
On 3/29/19 3:39 PM, Jakub Jelinek wrote: Hi! The following testcase is miscompiled, because when cp_build_modify_expr processes assignment into lvalue COND_EXPR, the rhs doesn't have side-effects and so stabilize_expr doesn't do anything to it, then we use that rhs in both COND_EXPR branches (bu

[C++ PATCH] Fix assignment to lvalue COND_EXPR vs. ubsan (PR sanitizer/89869)

2019-03-29 Thread Jakub Jelinek
Hi! The following testcase is miscompiled, because when cp_build_modify_expr processes assignment into lvalue COND_EXPR, the rhs doesn't have side-effects and so stabilize_expr doesn't do anything to it, then we use that rhs in both COND_EXPR branches (but shared) and finally during genericization