aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/synth/netlists-builders.adb1
-rw-r--r--src/synth/synth-context.adb5
2 files changed, 4 insertions, 2 deletions
diff --git a/src/synth/netlists-builders.adb b/src/synth/netlists-builders.adb
index 418daf308..f8c28eb01 100644
--- a/src/synth/netlists-builders.adb
+++ b/src/synth/netlists-builders.adb
@@ -620,7 +620,6 @@ package body Netlists.Builders is
Val : Uns32;
W : Width) return Net
is
- pragma Assert (W > 0);
Inst : Instance;
O : Net;
begin
diff --git a/src/synth/synth-context.adb b/src/synth/synth-context.adb
index 77ed71856..bced2e633 100644
--- a/src/synth/synth-context.adb
+++ b/src/synth/synth-context.adb
@@ -329,7 +329,10 @@ package body Synth.Context is
Has_Zx := False;
Off := 0;
Value2net (Val, Vec, Off, Has_Zx);
- if W <= 32 then
+ if W = 0 then
+ -- For null range (like the null string literal "")
+ Res := Build_Const_UB32 (Build_Context, 0, 0);
+ elsif W <= 32 then
-- 32 bit result.
if not Has_Zx then
Res := Build_Const_UB32 (Build_Context, Vec (0).Val, W);