aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-context.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-09-12 04:51:13 +0200
committerTristan Gingold <tgingold@free.fr>2019-09-12 04:51:13 +0200
commit2f50d278e367f64e1cd53b248c38c27add86981f (patch)
tree92d9a2d2321b1dfbdd7b05014d0e53e6b5d32ac3 /src/synth/synth-context.adb
parent43f89567b80e89dfcec9392552cc80e97a322230 (diff)
downloadghdl-2f50d278e367f64e1cd53b248c38c27add86981f.tar.gz
ghdl-2f50d278e367f64e1cd53b248c38c27add86981f.tar.bz2
ghdl-2f50d278e367f64e1cd53b248c38c27add86981f.zip
synth: allow empty string literal.
Diffstat (limited to 'src/synth/synth-context.adb')
-rw-r--r--src/synth/synth-context.adb5
1 files changed, 4 insertions, 1 deletions
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);