From 33a8546c81788a44e0ec542b205da8f0e1b9354c Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 6 Apr 2019 16:00:54 +0200 Subject: vhdl: improve error message for EOF in readline. --- libraries/std/textio_body.vhdl | 5 +++++ 1 file changed, 5 insertions(+) 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 -- cgit v1.2.3