diff options
Diffstat (limited to 'libgfortran/generated/parity_l1.c')
-rw-r--r-- | libgfortran/generated/parity_l1.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libgfortran/generated/parity_l1.c b/libgfortran/generated/parity_l1.c index 4fe64de..34cac76 100644 --- a/libgfortran/generated/parity_l1.c +++ b/libgfortran/generated/parity_l1.c @@ -52,8 +52,15 @@ parity_l1 (gfc_array_l1 * const restrict retarray, int continue_loop; /* Make dim zero based to avoid confusion. */ - dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; + dim = (*pdim) - 1; + + if (unlikely (dim < 0 || dim > rank)) + { + runtime_error ("Dim argument incorrect in PARITY intrinsic: " + "is %ld, should be between 1 and %ld", + (long int) dim + 1, (long int) rank + 1); + } len = GFC_DESCRIPTOR_EXTENT(array,dim); if (len < 0) |