diff options
-rw-r--r-- | src/vhdl/translate/trans-chap7.adb | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/vhdl/translate/trans-chap7.adb b/src/vhdl/translate/trans-chap7.adb index e93dce632..20f7185d1 100644 --- a/src/vhdl/translate/trans-chap7.adb +++ b/src/vhdl/translate/trans-chap7.adb @@ -2973,15 +2973,24 @@ package body Trans.Chap7 is El := Get_Association_Choices_Chain (Aggr); P := 0; loop - if El = Null_Iir then - return; - end if; + exit when El = Null_Iir; exit when Get_Kind (El) /= Iir_Kind_Choice_By_None; Do_Assign (El); - P := P + 1; + if not Final or else Get_Element_Type_Flag (El) then + P := P + 1; + else + P := P + Natural + (Eval_Discrete_Type_Length + (Get_Index_Type (Get_Type (Get_Associated_Expr (El)), 0))); + end if; El := Get_Chain (El); end loop; + -- End of chain. + if El = Null_Iir then + return; + end if; + pragma Assert (Get_Kind (El) = Iir_Kind_Choice_By_Others); -- Handle others. |