diff mbox

Fix a pasto in gfc_check_num_images

Message ID 20170731073947.GO2123@tucnak
State New
Headers show

Commit Message

Jakub Jelinek July 31, 2017, 7:39 a.m. UTC
Hi!

bootstrap-ubsan reported taking address of a &distance->where when
distance is NULL.  The function has one block guarded with if (distance)
and another guarded with if (failed), so I think this is just a pasto
from the earlier if (distance) block.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2017-07-31  Jakub Jelinek  <jakub@redhat.com>

	* check.c (gfc_check_num_images): Fix a pasto.


	Jakub

Comments

Richard Biener July 31, 2017, 8:51 a.m. UTC | #1
On Mon, Jul 31, 2017 at 9:39 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> bootstrap-ubsan reported taking address of a &distance->where when
> distance is NULL.  The function has one block guarded with if (distance)
> and another guarded with if (failed), so I think this is just a pasto
> from the earlier if (distance) block.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

Ok.

Richard.

> 2017-07-31  Jakub Jelinek  <jakub@redhat.com>
>
>         * check.c (gfc_check_num_images): Fix a pasto.
>
> --- gcc/fortran/check.c.jj      2017-03-05 22:39:52.000000000 +0100
> +++ gcc/fortran/check.c 2017-07-28 14:30:40.503511275 +0200
> @@ -5149,7 +5149,7 @@ gfc_check_num_images (gfc_expr *distance
>         return false;
>
>        if (!gfc_notify_std (GFC_STD_F2008_TS, "FAILED= argument to "
> -                          "NUM_IMAGES at %L", &distance->where))
> +                          "NUM_IMAGES at %L", &failed->where))
>         return false;
>      }
>
>
>         Jakub
diff mbox

Patch

--- gcc/fortran/check.c.jj	2017-03-05 22:39:52.000000000 +0100
+++ gcc/fortran/check.c	2017-07-28 14:30:40.503511275 +0200
@@ -5149,7 +5149,7 @@  gfc_check_num_images (gfc_expr *distance
 	return false;
 
       if (!gfc_notify_std (GFC_STD_F2008_TS, "FAILED= argument to "
-			   "NUM_IMAGES at %L", &distance->where))
+			   "NUM_IMAGES at %L", &failed->where))
 	return false;
     }