diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2020-06-14 14:39:03 +0200 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2020-06-14 14:39:03 +0200 |
commit | 4644e8f15f835a9934a8d289ee08ba4cb46cbfac (patch) | |
tree | ac243c4241bfe472b78db70a0b52acd0487a5daa /gcc/fortran | |
parent | 1af22e455584ef5fcad2b4474c1efc3fd26f6cb3 (diff) | |
download | gcc-4644e8f15f835a9934a8d289ee08ba4cb46cbfac.zip gcc-4644e8f15f835a9934a8d289ee08ba4cb46cbfac.tar.gz gcc-4644e8f15f835a9934a8d289ee08ba4cb46cbfac.tar.bz2 |
Always use locations from get and put arguments for error messages.
A simple and obvios patch - the error location was taken
from a variable that was not initialized for optional
variables.
gcc/fortran/ChangeLog:
* check.c (gfc_check_random_seed): Always use locations
from get and put arguments for error messages.
gcc/testsuite/ChangeLog:
* gfortran.dg/random_seed_4.f90: New test.
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/check.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c index 148a326..9c95524 100644 --- a/gcc/fortran/check.c +++ b/gcc/fortran/check.c @@ -6643,7 +6643,7 @@ gfc_check_random_seed (gfc_expr *size, gfc_expr *put, gfc_expr *get) gfc_error ("Size of %qs argument of %qs intrinsic at %L " "too small (%i/%i)", gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic, - where, (int) mpz_get_ui (put_size), seed_size); + &put->where, (int) mpz_get_ui (put_size), seed_size); } if (get != NULL) @@ -6675,7 +6675,7 @@ gfc_check_random_seed (gfc_expr *size, gfc_expr *put, gfc_expr *get) gfc_error ("Size of %qs argument of %qs intrinsic at %L " "too small (%i/%i)", gfc_current_intrinsic_arg[2]->name, gfc_current_intrinsic, - where, (int) mpz_get_ui (get_size), seed_size); + &get->where, (int) mpz_get_ui (get_size), seed_size); } /* RANDOM_SEED may not have more than one non-optional argument. */ |