From: Jakub Jelinek Date: Wed, 15 Nov 2017 08:40:32 +0000 (+0100) Subject: re PR tree-optimization/82977 (AddressSanitizer: heap-use-after-free in strlen_optimi... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=65205a116a8d1c076f0709d92acad2453caa1efb;p=gcc.git re PR tree-optimization/82977 (AddressSanitizer: heap-use-after-free in strlen_optimize_stmt .././../gcc/tree-ssa-strlen.c:2971) PR tree-optimization/82977 * tree-ssa-strlen.c (strlen_optimize_stmt): Pass a reference to a copy constructed temporary to strlen_to_stridx.put. From-SVN: r254757 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5d115b6257a..fd72410e186 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-11-15 Jakub Jelinek + + PR tree-optimization/82977 + * tree-ssa-strlen.c (strlen_optimize_stmt): Pass a reference to a copy + constructed temporary to strlen_to_stridx.put. + 2017-11-15 Martin Liska * configure.ac: Remove -fkeep-inline-functions from coverage_flags. diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c index 2efa18275fd..ff3230144b0 100644 --- a/gcc/tree-ssa-strlen.c +++ b/gcc/tree-ssa-strlen.c @@ -2968,7 +2968,7 @@ strlen_optimize_stmt (gimple_stmt_iterator *gsi) tree rhs1 = gimple_assign_rhs1 (stmt); if (stridx_strlenloc *ps = strlen_to_stridx.get (rhs1)) - strlen_to_stridx.put (lhs, *ps); + strlen_to_stridx.put (lhs, stridx_strlenloc (*ps)); } else if (TREE_CODE (lhs) != SSA_NAME && !TREE_SIDE_EFFECTS (lhs)) {