summaryrefslogtreecommitdiff
path: root/translate/grt/grt-waves.adb
diff options
context:
space:
mode:
authorTristan Gingold2014-01-13 02:40:01 +0100
committerTristan Gingold2014-01-13 02:40:01 +0100
commit86bfd8ac497f4e4a753ddbd9d382b377d876dcbc (patch)
tree3035168b395c5f301b8c344c3cd1f881d4c6031c /translate/grt/grt-waves.adb
parenteae904baf0e76f48c755e5ae91b1c0eff5729796 (diff)
downloadghdl-86bfd8ac497f4e4a753ddbd9d382b377d876dcbc.tar.gz
ghdl-86bfd8ac497f4e4a753ddbd9d382b377d876dcbc.tar.bz2
ghdl-86bfd8ac497f4e4a753ddbd9d382b377d876dcbc.zip
Fix bug20312: rewrite of complex types.
Fix crashes in sem_expr when string literals are used in range exprs.
Diffstat (limited to 'translate/grt/grt-waves.adb')
-rw-r--r--translate/grt/grt-waves.adb59
1 files changed, 27 insertions, 32 deletions
diff --git a/translate/grt/grt-waves.adb b/translate/grt/grt-waves.adb
index 7bcb0df..fb43fd1 100644
--- a/translate/grt/grt-waves.adb
+++ b/translate/grt/grt-waves.adb
@@ -629,15 +629,14 @@ package body Grt.Waves is
Create_String_Id (Enum.Names (I - 1));
end loop;
end;
- when Ghdl_Rtik_Subtype_Array
- | Ghdl_Rtik_Subtype_Array_Ptr =>
+ when Ghdl_Rtik_Subtype_Array =>
declare
Arr : Ghdl_Rtin_Subtype_Array_Acc;
B_Ctxt : Rti_Context;
begin
Arr := To_Ghdl_Rtin_Subtype_Array_Acc (Rti);
Create_String_Id (Arr.Name);
- if Rti.Mode = Ghdl_Rti_Type_Complex then
+ if Rti_Complex_Type (Rti) then
B_Ctxt := Ctxt;
else
B_Ctxt := N_Ctxt;
@@ -1271,8 +1270,7 @@ package body Grt.Waves is
Write_String_Id (Enum.Names (I - 1));
end loop;
end;
- when Ghdl_Rtik_Subtype_Array
- | Ghdl_Rtik_Subtype_Array_Ptr =>
+ when Ghdl_Rtik_Subtype_Array =>
declare
Arr : Ghdl_Rtin_Subtype_Array_Acc;
begin
@@ -1351,33 +1349,30 @@ package body Grt.Waves is
for I in 1 .. Base.Nbr loop
Unit := To_Ghdl_Rtin_Unit_Acc (Base.Units (I - 1));
Write_String_Id (Unit.Name);
- case Base.Common.Mode is
- when 0 =>
- -- Value is locally static.
- case Base.Common.Kind is
- when Ghdl_Rtik_Type_P32 =>
- Wave_Put_SLEB128 (Unit.Value.Unit_32);
- when Ghdl_Rtik_Type_P64 =>
- Wave_Put_LSLEB128 (Unit.Value.Unit_64);
- when others =>
- Internal_Error
- ("wave.write_types(P32/P64-0)");
- end case;
- when 1 =>
- case Rti.Kind is
- when Ghdl_Rtik_Type_P32 =>
- Wave_Put_SLEB128
- (Unit.Value.Unit_Addr.I32);
- when Ghdl_Rtik_Type_P64 =>
- Wave_Put_LSLEB128
- (Unit.Value.Unit_Addr.I64);
- when others =>
- Internal_Error
- ("wave.write_types(P32/P64-1)");
- end case;
- when others =>
- Internal_Error ("wave.write_types(P32/P64)");
- end case;
+ if Rti_Non_Static_Physical_Type (Rti) then
+ case Rti.Kind is
+ when Ghdl_Rtik_Type_P32 =>
+ Wave_Put_SLEB128
+ (Unit.Value.Unit_Addr.I32);
+ when Ghdl_Rtik_Type_P64 =>
+ Wave_Put_LSLEB128
+ (Unit.Value.Unit_Addr.I64);
+ when others =>
+ Internal_Error
+ ("wave.write_types(P32/P64-1)");
+ end case;
+ else
+ -- Value is locally static.
+ case Base.Common.Kind is
+ when Ghdl_Rtik_Type_P32 =>
+ Wave_Put_SLEB128 (Unit.Value.Unit_32);
+ when Ghdl_Rtik_Type_P64 =>
+ Wave_Put_LSLEB128 (Unit.Value.Unit_64);
+ when others =>
+ Internal_Error
+ ("wave.write_types(P32/P64-0)");
+ end case;
+ end if;
end loop;
end;
when others =>