aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-files_operations.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-03-25 12:39:53 +0100
committerTristan Gingold <tgingold@free.fr>2020-03-25 12:39:53 +0100
commit60a469e6b5f3a6df29558e8e98fdc5510886dee3 (patch)
tree15a0b0999c931b927006d97c9a19ec8dc00c19ef /src/synth/synth-files_operations.adb
parent88430d7566d72714268f6be31e542600745a1036 (diff)
downloadghdl-60a469e6b5f3a6df29558e8e98fdc5510886dee3.tar.gz
ghdl-60a469e6b5f3a6df29558e8e98fdc5510886dee3.tar.bz2
ghdl-60a469e6b5f3a6df29558e8e98fdc5510886dee3.zip
synth: improve propagation of errors.
Diffstat (limited to 'src/synth/synth-files_operations.adb')
-rw-r--r--src/synth/synth-files_operations.adb11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/synth/synth-files_operations.adb b/src/synth/synth-files_operations.adb
index 29c70d98d..5c8b6b153 100644
--- a/src/synth/synth-files_operations.adb
+++ b/src/synth/synth-files_operations.adb
@@ -64,16 +64,19 @@ package body Synth.Files_Operations is
procedure Convert_File_Name (Val : Value_Acc;
Res : out C_File_Name;
Len : out Natural;
- Status : out Op_Status) is
+ Status : out Op_Status)
+ is
+ Name : constant Value_Acc := Strip_Alias_Const (Val);
+ pragma Unreferenced (Val);
begin
- Len := Natural (Val.Arr.Len);
+ Len := Natural (Name.Arr.Len);
if Len >= Res'Length - 1 then
Status := Op_Filename_Error;
return;
end if;
- Convert_String (Val, Res (1 .. Len));
+ Convert_String (Name, Res (1 .. Len));
Res (Len + 1) := Grt.Types.NUL;
Status := Op_Ok;
@@ -149,7 +152,7 @@ package body Synth.Files_Operations is
if Status = Op_Name_Error then
Error_Msg_Synth
(+Decl, "cannot open file: " & C_Name (1 .. C_Name_Len));
- raise File_Execution_Error;
+ Set_Error (Syn_Inst);
else
File_Error (Decl, Status);
end if;