diff options
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 7 | ||||
-rw-r--r-- | libgfortran/io/async.c | 7 | ||||
-rw-r--r-- | libgfortran/runtime/error.c | 4 |
3 files changed, 18 insertions, 0 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 71c233c..ddb1af1 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,10 @@ +2020-05-23 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR libfortran/95191 + * io/async.c (async_wait_id): Generate error if ID is higher + than the highest current ID. + * runtime/error.c (translate_error): Handle LIBERROR_BAD_WAIT_ID. + 2020-05-21 H.J. Lu <hongjiu.lu@intel.com> * m4/matmul.m4: Don't include <config/i386/cpuinfo.h>. Use diff --git a/libgfortran/io/async.c b/libgfortran/io/async.c index 63b9158..1bf38e9 100644 --- a/libgfortran/io/async.c +++ b/libgfortran/io/async.c @@ -424,6 +424,13 @@ async_wait_id (st_parameter_common *cmp, async_unit *au, int i) } LOCK (&au->lock); + if (i > au->id.high) + { + generate_error_common (cmp, LIBERROR_BAD_WAIT_ID, NULL); + UNLOCK (&au->lock); + return true; + } + NOTE ("Waiting for id %d", i); if (au->id.waiting < i) au->id.waiting = i; diff --git a/libgfortran/runtime/error.c b/libgfortran/runtime/error.c index 9ed5d56..ff6b852 100644 --- a/libgfortran/runtime/error.c +++ b/libgfortran/runtime/error.c @@ -660,6 +660,10 @@ translate_error (int code) p = "Inquire statement identifies an internal file"; break; + case LIBERROR_BAD_WAIT_ID: + p = "Bad ID in WAIT statement"; + break; + default: p = "Unknown error code"; break; |