[PATCH] Do not use tree_to_wide_ref that point to a temporary (PR c++/90587).
Richard Biener
richard.guenther@gmail.com
Thu May 23 11:20:00 GMT 2019
On Thu, May 23, 2019 at 12:51 PM Martin Liška <mliska@suse.cz> wrote:
>
> Hi.
>
> The PR is about use-after-scope issue where:
> wi::tree_to_wide_ref andw = wi::to_wide (val) & wi::to_wide (boundary);
>
> The RHS1 and RHS2 will become out-of-scope after operator& returns a reference.
> andw.val then points to one of RHS1 or RHS2. So that we end up with an use-after-scope.
>
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>
> Ready to be installed?
OK.
Richard.
> Thanks,
> Martin
>
> gcc/ChangeLog:
>
> 2019-05-23 Martin Liska <mliska@suse.cz>
>
> PR c++/90587.
> * tree-ssa-uninit.c (value_sat_pred_p): The result of &
> operation points to a temporary (pointed via tree_to_wide_ref)
> that is out of scope after the &.
> ---
> gcc/tree-ssa-uninit.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>
More information about the Gcc-patches
mailing list