aboutsummaryrefslogtreecommitdiffstats
path: root/src/libraries.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-02-13 21:13:00 +0100
committerTristan Gingold <tgingold@free.fr>2017-02-13 21:13:00 +0100
commit19629cdc1576bb17a033ac57c8ef7eb239e45fe6 (patch)
tree87e483610a7c05be3e55b7c76279f29ab37abed4 /src/libraries.adb
parent38886eafc52f3c792c6693784d69748d4bedf12d (diff)
downloadghdl-19629cdc1576bb17a033ac57c8ef7eb239e45fe6.tar.gz
ghdl-19629cdc1576bb17a033ac57c8ef7eb239e45fe6.tar.bz2
ghdl-19629cdc1576bb17a033ac57c8ef7eb239e45fe6.zip
libraries: fix incorrect use of scanner during sem.
Diffstat (limited to 'src/libraries.adb')
-rw-r--r--src/libraries.adb10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/libraries.adb b/src/libraries.adb
index 20a303c66..7359b1bc6 100644
--- a/src/libraries.adb
+++ b/src/libraries.adb
@@ -746,12 +746,10 @@ package body Libraries is
is
Library: Iir_Library_Declaration;
begin
- -- library work is a little bit special.
+ -- The library work is a little bit special.
if Ident = Std_Names.Name_Work or else Ident = Work_Library_Name then
- if Work_Library = Null_Iir then
- -- load_work_library must have been called before.
- raise Internal_Error;
- end if;
+ -- load_work_library must have been called before.
+ pragma Assert (Work_Library /= Null_Iir);
return Work_Library;
end if;
@@ -768,7 +766,7 @@ package body Libraries is
end if;
Library := Create_Iir (Iir_Kind_Library_Declaration);
- Set_Location (Library, Scanner.Get_Token_Location);
+ Set_Location (Library, Loc);
Set_Library_Directory (Library, Null_Identifier);
Set_Identifier (Library, Ident);
if Load_Library (Library) = False then