From 905d47a9507cc15446a517fce0aa050344fdeb53 Mon Sep 17 00:00:00 2001 From: Bud Davis Date: Sun, 28 Nov 2004 21:14:02 +0000 Subject: direct_io_2.f90: New test. 2004-11-28 Bud Davis * gcc/gcc/gfortran.dg/direct_io_2.f90: New test. * gcc/libgfortran/io/unix.c (mmap_alloc_w_a): check for a write to a location less than the mapped area. From-SVN: r91426 --- libgfortran/io/unix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libgfortran/io/unix.c') diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c index 45d8cfd..2e9d9a4 100644 --- a/libgfortran/io/unix.c +++ b/libgfortran/io/unix.c @@ -667,7 +667,8 @@ mmap_alloc_w_at (unix_stream * s, int *len, gfc_offset where) } if ((s->buffer == NULL || s->buffer_offset > where || - where + *len > s->buffer_offset + s->active) && + where + *len > s->buffer_offset + s->active || + where < s->buffer_offset + s->active) && mmap_alloc (s, where, len) == FAILURE) return NULL; -- cgit v1.1