[gcc(refs/users/mikael/heads/refactor_descriptor_v203.04)] Correction realloc_on_assign_27

Mikael Morin via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:6e257e975c97ff50917cd4fe07c231f4b0e1089e

commit 6e257e975c97ff50917cd4fe07c231f4b0e1089e
Author: Mikael Morin <[email protected]>
Date:   Wed Jul 15 13:26:24 2026 +0200

    Correction realloc_on_assign_27

Diff:
---
 gcc/fortran/trans-expr.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc
index 7bc3875b9880..f135c6358eeb 100644
--- a/gcc/fortran/trans-expr.cc
+++ b/gcc/fortran/trans-expr.cc
@@ -13114,8 +13114,8 @@ trans_class_assignment (stmtblock_t *block, gfc_expr *lhs, gfc_expr *rhs,
 	  re = build_call_expr_loc (input_location,
 				    builtin_decl_explicit (BUILT_IN_REALLOC),
 				    2, tmp, size);
-	  re = fold_build2_loc (input_location, MODIFY_EXPR, TREE_TYPE (tmp),
-				tmp, re);
+	  re = fold_build2_loc (input_location, MODIFY_EXPR,
+				TREE_TYPE (class_han), class_han, re);
 	  tmp = fold_build2_loc (input_location, NE_EXPR,
 				 logical_type_node, rhs_vptr, old_vptr);
 	  re = fold_build3_loc (input_location, COND_EXPR, void_type_node,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.