aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-ieee-numeric_std.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/synth/synth-ieee-numeric_std.adb')
-rw-r--r--src/synth/synth-ieee-numeric_std.adb6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/synth/synth-ieee-numeric_std.adb b/src/synth/synth-ieee-numeric_std.adb
index f850456b0..19fa1145d 100644
--- a/src/synth/synth-ieee-numeric_std.adb
+++ b/src/synth/synth-ieee-numeric_std.adb
@@ -50,7 +50,11 @@ package body Synth.Ieee.Numeric_Std is
if Otyp.Abound.Len = Len
and then Otyp.Abound.Right = 0
and then Otyp.Abound.Dir = Dir_Downto
+ and then not Otyp.Is_Global
then
+ -- Try to reuse the same type as the parameter.
+ -- But the result type must be allocated on the expr_pool.
+ -- FIXME: is this code ever executed ?
pragma Assert (Otyp.Abound.Left = Int32 (Len) - 1);
return Otyp;
end if;
@@ -847,7 +851,7 @@ package body Synth.Ieee.Numeric_Std is
is
Res : Memory_Ptr;
begin
- Res := Alloc_Memory (V.Typ);
+ Res := Alloc_Memory (V.Typ, Current_Pool);
Neg_Vec (V.Mem, Res, V.Typ);
return Res;