aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/unix.c
diff options
context:
space:
mode:
authorBud Davis <bdavis9659@comcast.net>2004-11-28 21:14:02 +0000
committerBud Davis <bdavis@gcc.gnu.org>2004-11-28 21:14:02 +0000
commit905d47a9507cc15446a517fce0aa050344fdeb53 (patch)
tree89d7f6bc7734d8a3ecf12aac0f4cbe7e31547a34 /libgfortran/io/unix.c
parent856e49c207daeb5ef0d24e43e432f6215b24ef33 (diff)
downloadgcc-905d47a9507cc15446a517fce0aa050344fdeb53.zip
gcc-905d47a9507cc15446a517fce0aa050344fdeb53.tar.gz
gcc-905d47a9507cc15446a517fce0aa050344fdeb53.tar.bz2
direct_io_2.f90: New test.
2004-11-28 Bud Davis <bdavis9659@comcast.net> * 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
Diffstat (limited to 'libgfortran/io/unix.c')
-rw-r--r--libgfortran/io/unix.c3
1 files changed, 2 insertions, 1 deletions
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;