aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-11-14 18:24:07 +0100
committerTristan Gingold <tgingold@free.fr>2018-11-14 18:24:07 +0100
commit42765ddc6dcd3461a15e1c20e623edad81f2915b (patch)
tree92e52b065836bdd3f9db39958613f080aac53839 /src
parent75680ebfba391d0c4abea7b9d559409a2b59d3f2 (diff)
downloadghdl-42765ddc6dcd3461a15e1c20e623edad81f2915b.tar.gz
ghdl-42765ddc6dcd3461a15e1c20e623edad81f2915b.tar.bz2
ghdl-42765ddc6dcd3461a15e1c20e623edad81f2915b.zip
scanner: detect EOF in strings
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/scanner.adb7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vhdl/scanner.adb b/src/vhdl/scanner.adb
index f91357922..8a8150b89 100644
--- a/src/vhdl/scanner.adb
+++ b/src/vhdl/scanner.adb
@@ -453,6 +453,13 @@ package body Scanner is
Error_Msg_Scan ("format effector not allowed in a string");
exit;
when Invalid =>
+ if C = Files_Map.EOT
+ and then Pos >= Current_Context.File_Len
+ then
+ Error_Msg_Scan ("string not terminated at end of file");
+ exit;
+ end if;
+
Error_Msg_Scan
("invalid character not allowed, even in a string");
when Graphic_Character =>