[Bug fortran/35991] run-time abort for CSHIFT of zero sized array
jvdelisle at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Sun Apr 20 20:17:00 GMT 2008
------- Comment #2 from jvdelisle at gcc dot gnu dot org 2008-04-20 20:16 -------
This obvious patch fixes it.
Index: cshift0.c
===================================================================
--- cshift0.c (revision 134473)
+++ cshift0.c (working copy)
@@ -202,7 +202,7 @@ cshift0 (gfc_array_char * ret, const gfc
rptr = ret->data;
sptr = array->data;
- shift = shift % (ssize_t)len;
+ shift = len == 0 ? 0 : shift % (ssize_t)len;
if (shift < 0)
shift += len;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35991
More information about the Gcc-bugs
mailing list