aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorDaniel Franke <franke.daniel@gmail.com>2010-06-09 17:36:33 -0400
committerDaniel Franke <dfranke@gcc.gnu.org>2010-06-09 17:36:33 -0400
commit70987f6299983c5a764c37827a95f71f831087f0 (patch)
treed0261b1558010b2bff855fc04710cf96134d1417 /gcc/fortran
parent33169a2285f10e2cfe0caf3f23628b074253e8cc (diff)
downloadgcc-70987f6299983c5a764c37827a95f71f831087f0.zip
gcc-70987f6299983c5a764c37827a95f71f831087f0.tar.gz
gcc-70987f6299983c5a764c37827a95f71f831087f0.tar.bz2
re PR fortran/44347 (SELECT_REAL_KIND: Wrongly accepts non-scalar arguments)
gcc/fortran/: 2010-06-09 Daniel Franke <franke.daniel@gmail.com> PR fortran/44347 * check.c (gfc_check_selected_real_kind): Verify that the actual arguments are scalar. gcc/testsuite/: 2010-06-09 Daniel Franke <franke.daniel@gmail.com> PR fortran/44347 * gfortran.dg/selected_real_kind_1.f90: New. From-SVN: r160506
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/check.c20
2 files changed, 22 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index cafbd31..c67dd8f 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,5 +1,11 @@
2010-06-09 Daniel Franke <franke.daniel@gmail.com>
+ PR fortran/44347
+ * check.c (gfc_check_selected_real_kind): Verify that the
+ actual arguments are scalar.
+
+2010-06-09 Daniel Franke <franke.daniel@gmail.com>
+
PR fortran/44359
* intrinsic.c (gfc_convert_type_warn): Further improve -Wconversion.
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 6a5c263..81f3e24 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -2930,11 +2930,23 @@ gfc_check_selected_real_kind (gfc_expr *p, gfc_expr *r)
return FAILURE;
}
- if (p != NULL && type_check (p, 0, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (p)
+ {
+ if (type_check (p, 0, BT_INTEGER) == FAILURE)
+ return FAILURE;
- if (r != NULL && type_check (r, 1, BT_INTEGER) == FAILURE)
- return FAILURE;
+ if (scalar_check (p, 0) == FAILURE)
+ return FAILURE;
+ }
+
+ if (r)
+ {
+ if (type_check (r, 1, BT_INTEGER) == FAILURE)
+ return FAILURE;
+
+ if (scalar_check (r, 1) == FAILURE)
+ return FAILURE;
+ }
return SUCCESS;
}