From 58eaa9531816ca832d43ca2cac0618ec91a246e1 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 27 Apr 2019 07:58:04 +0200 Subject: translation: adjust scan of vhpidirect string. --- src/vhdl/translate/translation.adb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/vhdl/translate') diff --git a/src/vhdl/translate/translation.adb b/src/vhdl/translate/translation.adb index 9cc217d7e..fd68e2f84 100644 --- a/src/vhdl/translate/translation.adb +++ b/src/vhdl/translate/translation.adb @@ -145,21 +145,20 @@ package body Translation is end if; -- Extract library. Lf := P; - while P < Length and then Name (P) /= ' ' loop + while P <= Length and then Name (P) /= ' ' loop P := P + 1; end loop; - Ll := P; + Ll := P - 1; -- Extract subprogram. - P := P + 1; while P <= Length and then Name (P) = ' ' loop P := P + 1; end loop; Sf := P; - while P < Length and then Name (P) /= ' ' loop + while P <= Length and then Name (P) /= ' ' loop P := P + 1; end loop; - Sl := P; - if P < Length then + Sl := P - 1; + if P <= Length then Error_Msg_Sem (+Spec, "garbage at end of VHPIDIRECT"); end if; -- cgit v1.2.3