This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[fortran, committed] Fix PR 34549


Hello world,

I committed the attached patch as obvious, revision 131136.

	Thomas

2007-12-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/34549
	* check.c (gfc_check_cshift):  Add check that shift is
	type INTEGER.

2007-12-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/34549
	* cshift_shift_real_1.f90:  New test.
	
! { dg-do compile }
! PR 34549 - a real value was accepted for shift.
program main
  implicit none
  real, dimension(2,2) :: r
  data r /1.0, 2.0, 3.0, 4.0/
  print *,cshift(r,shift=2.3,dim=1) ! { dg-error "must be INTEGER" }
end program main
Index: check.c
===================================================================
--- check.c	(revision 130993)
+++ check.c	(working copy)
@@ -853,6 +853,9 @@ gfc_check_cshift (gfc_expr *array, gfc_e
   if (array_check (array, 0) == FAILURE)
     return FAILURE;
 
+  if (type_check (shift, 1, BT_INTEGER) == FAILURE)
+    return FAILURE;
+
   if (array->rank == 1)
     {
       if (scalar_check (shift, 1) == FAILURE)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]