diff mbox series

Only return after resetting type_param_spec_list

Message ID qnn8n3os-442o-ps3r-1o28-461r60s111s@fhfr.qr
State Committed
Commit b962469a01b017ae2e7ef2865a40e37094ceec4b
Headers show
Series Only return after resetting type_param_spec_list | expand

Commit Message

Richard Biener Nov. 29, 2021, 11:28 a.m. UTC
This fixes an appearant mistake in gfc_insert_parameter_exprs.

Bootstrap / regtest pending on x86_64-unknown-linux-gnu.

OK?

Thanks,
Richard.

2021-11-29  Richard Biener  <rguenther@suse.de>

gcc/fortran/
	* decl.c (gfc_insert_parameter_exprs): Only return after
	resetting type_param_spec_list.
---
 gcc/fortran/decl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Harald Anlauf Nov. 29, 2021, 7:36 p.m. UTC | #1
Am 29.11.21 um 12:28 schrieb Richard Biener via Fortran:
> This fixes an appearant mistake in gfc_insert_parameter_exprs.

Yes, that looks pretty much like a missed cleanup and fix during
development.  CC'ing Paul.

> Bootstrap / regtest pending on x86_64-unknown-linux-gnu.
>
> OK?

LGTM if it regtests.

Thanks,
Harald

> Thanks,
> Richard.
>
> 2021-11-29  Richard Biener  <rguenther@suse.de>
>
> gcc/fortran/
> 	* decl.c (gfc_insert_parameter_exprs): Only return after
> 	resetting type_param_spec_list.
> ---
>   gcc/fortran/decl.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
> index c0fec90e3e0..4971638f9b6 100644
> --- a/gcc/fortran/decl.c
> +++ b/gcc/fortran/decl.c
> @@ -3733,9 +3733,9 @@ gfc_insert_parameter_exprs (gfc_expr *e, gfc_actual_arglist *param_list)
>   {
>     gfc_actual_arglist *old_param_spec_list = type_param_spec_list;
>     type_param_spec_list = param_list;
> -  return gfc_traverse_expr (e, NULL, &insert_parameter_exprs, 1);
> -  type_param_spec_list = NULL;
> +  bool res = gfc_traverse_expr (e, NULL, &insert_parameter_exprs, 1);
>     type_param_spec_list = old_param_spec_list;
> +  return res;
>   }
>
>   /* Determines the instance of a parameterized derived type to be used by
>
diff mbox series

Patch

diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index c0fec90e3e0..4971638f9b6 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -3733,9 +3733,9 @@  gfc_insert_parameter_exprs (gfc_expr *e, gfc_actual_arglist *param_list)
 {
   gfc_actual_arglist *old_param_spec_list = type_param_spec_list;
   type_param_spec_list = param_list;
-  return gfc_traverse_expr (e, NULL, &insert_parameter_exprs, 1);
-  type_param_spec_list = NULL;
+  bool res = gfc_traverse_expr (e, NULL, &insert_parameter_exprs, 1);
   type_param_spec_list = old_param_spec_list;
+  return res;
 }
 
 /* Determines the instance of a parameterized derived type to be used by