* [PATCH] fortran/50524 -- Check return status of resolving substring ref
@ 2011-10-16 8:15 Steve Kargl
2011-10-16 10:32 ` Janus Weil
0 siblings, 1 reply; 2+ messages in thread
From: Steve Kargl @ 2011-10-16 8:15 UTC (permalink / raw)
To: fortran, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 335 bytes --]
resolve_ref() calls resolve_substring() but failed to check
its return value. This patch does the check.
2011-10-15 Steven G. Kargl <kargl@gcc.gcu.org>
* resolve.c (resolve_ref): Check return value of resolve_substring().
2011-10-15 Steven G. Kargl <kargl@gcc.gcu.org>
* gfortran.dg/substring_integer_index.f90: New test.
[-- Attachment #2: substring.diff --]
[-- Type: text/x-diff, Size: 813 bytes --]
Index: fortran/resolve.c
===================================================================
--- fortran/resolve.c (revision 179940)
+++ fortran/resolve.c (working copy)
@@ -4858,7 +4859,8 @@ resolve_ref (gfc_expr *expr)
break;
case REF_SUBSTRING:
- resolve_substring (ref);
+ if (resolve_substring (ref) == FAILURE)
+ return FAILURE;
break;
}
Index: testsuite/gfortran.dg/substring_integer_index.f90
===================================================================
--- testsuite/gfortran.dg/substring_integer_index.f90 (revision 0)
+++ testsuite/gfortran.dg/substring_integer_index.f90 (revision 0)
@@ -0,0 +1,8 @@
+! { dg-do compile }
+! PR fortran/50524
+!
+program foo
+ print *, 'abc'(2.e0:3) ! { dg-error "must be of type INTEGER"}
+ print *,'qwe'(1:1e0)
+end program foo
+
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] fortran/50524 -- Check return status of resolving substring ref
2011-10-16 8:15 [PATCH] fortran/50524 -- Check return status of resolving substring ref Steve Kargl
@ 2011-10-16 10:32 ` Janus Weil
0 siblings, 0 replies; 2+ messages in thread
From: Janus Weil @ 2011-10-16 10:32 UTC (permalink / raw)
To: Steve Kargl; +Cc: fortran, gcc-patches
Hi Steve,
> resolve_ref() calls resolve_substring() but failed to check
> its return value. This patch does the check.
Looks pretty obvious. Please commit.
Thanks for the patch,
Janus
> 2011-10-15 Steven G. Kargl <kargl@gcc.gcu.org>
>
> * resolve.c (resolve_ref): Check return value of resolve_substring().
>
>
> 2011-10-15 Steven G. Kargl <kargl@gcc.gcu.org>
>
> * gfortran.dg/substring_integer_index.f90: New test.
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-10-16 8:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-16 8:15 [PATCH] fortran/50524 -- Check return status of resolving substring ref Steve Kargl
2011-10-16 10:32 ` Janus Weil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).