diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-04-06 16:00:54 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-04-06 16:00:54 +0200 |
commit | 33a8546c81788a44e0ec542b205da8f0e1b9354c (patch) | |
tree | 3028be12e9a7c198e7bbf6a94a61d8be8cc35bab | |
parent | dd33f2648b1f258d210052c8ca5fd2644fcb0909 (diff) | |
download | ghdl-33a8546c81788a44e0ec542b205da8f0e1b9354c.tar.gz ghdl-33a8546c81788a44e0ec542b205da8f0e1b9354c.tar.bz2 ghdl-33a8546c81788a44e0ec542b205da8f0e1b9354c.zip |
vhdl: improve error message for EOF in readline.
-rw-r--r-- | libraries/std/textio_body.vhdl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libraries/std/textio_body.vhdl b/libraries/std/textio_body.vhdl index 83a9a00da..d01cb8bad 100644 --- a/libraries/std/textio_body.vhdl +++ b/libraries/std/textio_body.vhdl @@ -415,6 +415,11 @@ package body textio is deallocate (l); end if; + -- End of file is not expected. The user should check endfile before + -- calling readline. + assert not endfile (f) + report "eof in std.textio.readline" severity failure; + -- We read the input in 128-byte chunks. -- We keep reading until we reach a newline or there is no more input. -- The loop invariant is that old_l is allocated and contains the |