diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-06-17 21:53:30 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-06-17 21:53:30 +0200 |
commit | 887496173322c262a976ac48d391d89255bf83f0 (patch) | |
tree | 82ff89fc4413cbc89b0132ed993c12f33a954524 /src/vhdl/translate/translation.adb | |
parent | 473c83961abe4e2fb52c8812e46bf19a41fe52cf (diff) | |
download | ghdl-887496173322c262a976ac48d391d89255bf83f0.tar.gz ghdl-887496173322c262a976ac48d391d89255bf83f0.tar.bz2 ghdl-887496173322c262a976ac48d391d89255bf83f0.zip |
vhdl: add ghdl_integer_index_check_failed. For #1257
Improve error message in case of (integer) index not in bounds.
Diffstat (limited to 'src/vhdl/translate/translation.adb')
-rw-r--r-- | src/vhdl/translate/translation.adb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/vhdl/translate/translation.adb b/src/vhdl/translate/translation.adb index 693212776..519671970 100644 --- a/src/vhdl/translate/translation.adb +++ b/src/vhdl/translate/translation.adb @@ -1107,6 +1107,21 @@ package body Translation is Check_Stack_Allocation_Threshold := O_Cnode_Null; end if; + -- procedure __ghdl_integer_indexed_check_failed + -- (filename : char_ptr_type; + -- line : ghdl_i32; + -- val : standard_integer; + -- rng : integer_range_ptr); + Start_Procedure_Decl + (Interfaces, Get_Identifier ("__ghdl_integer_index_check_failed"), + O_Storage_External); + New_Interface_Decl (Interfaces, Param, Wki_Filename, Char_Ptr_Type); + New_Interface_Decl (Interfaces, Param, Wki_Line, Ghdl_I32_Type); + New_Interface_Decl (Interfaces, Param, Wki_Val, Std_Integer_Otype); + New_Interface_Decl (Interfaces, Param, Get_Identifier ("rng"), + Get_Info (Integer_Type_Definition).B.Range_Ptr_Type); + Finish_Subprogram_Decl (Interfaces, Ghdl_Integer_Index_Check_Failed); + -- procedure __ghdl_text_write (file : __ghdl_file_index; -- str : std_string_ptr); Start_Procedure_Decl |