diff options
author | Jason Merrill <jason@redhat.com> | 2022-12-20 21:06:09 -0500 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2022-12-20 21:07:31 -0500 |
commit | ef0abcbc400e0ecb8ed1ddf61d96f8f3f88fe63b (patch) | |
tree | 8a50dd12886f90efacee68469a337b6b9e6047a3 /gcc/fold-const.cc | |
parent | 302485a70a33f3a86e85ad9051de2b51c5dc0bc0 (diff) | |
download | gcc-ef0abcbc400e0ecb8ed1ddf61d96f8f3f88fe63b.zip gcc-ef0abcbc400e0ecb8ed1ddf61d96f8f3f88fe63b.tar.gz gcc-ef0abcbc400e0ecb8ed1ddf61d96f8f3f88fe63b.tar.bz2 |
fold: fix use of protected_set_expr_location_unshare
Unlike protected_set_expr_location, this variant can return
a different tree.
gcc/ChangeLog:
* fold-const.cc (fold_convert_loc): Check return value of
protected_set_expr_location_unshare.
Diffstat (limited to 'gcc/fold-const.cc')
-rw-r--r-- | gcc/fold-const.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/fold-const.cc b/gcc/fold-const.cc index 42547f4..00e2af0 100644 --- a/gcc/fold-const.cc +++ b/gcc/fold-const.cc @@ -2618,7 +2618,7 @@ fold_convert_loc (location_t loc, tree type, tree arg) gcc_unreachable (); } fold_convert_exit: - protected_set_expr_location_unshare (tem, loc); + tem = protected_set_expr_location_unshare (tem, loc); return tem; } |