]> gcc.gnu.org Git - gcc.git/commitdiff
fold: fix use of protected_set_expr_location_unshare
authorJason Merrill <jason@redhat.com>
Wed, 21 Dec 2022 02:06:09 +0000 (21:06 -0500)
committerJason Merrill <jason@redhat.com>
Wed, 21 Dec 2022 02:07:31 +0000 (21:07 -0500)
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.

gcc/fold-const.cc

index 42547f433ed9b093d0eab10bc9f33ea20fe79df7..00e2af0680cf1e2ec5c312b3a9e6a76ccaa47434 100644 (file)
@@ -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;
 }
 \f
This page took 0.07638 seconds and 5 git commands to generate.