in:
procedure read (l: inout line; value: out string; good: out boolean)
When l is (a pointer to) string(1 to 1) (eg. after write(l, a
character)), and then I am trying to read a string of one character from
l, I get a runtime error.
The reason is that because l'left < l'right is false (l'ascending cannot
be used, since ascending does not exist in VHDL-87), value := l (1
downto 1) further down, which fails, because the array direction is to
(and not downto).
The attached patch seems to fix this.
Tom
--- gcc/vhdl/libraries/std/textio_body.vhdl.orig 2009-05-25 18:13:20.000000000 +0200
+++ gcc/vhdl/libraries/std/textio_body.vhdl 2009-05-25 18:14:31.000000000 +0200
@@ -1308,7 +1308,11 @@
value := l (l'left to l'left + len - 1);
trim (l, l'left + len);
else
- value := l (l'left downto l'left - len + 1);
+ if len = 1 then
+ value (value'left) := l (l'left);
+ else
+ value := l (l'left downto l'left - len + 1);
+ end if;
trim (l, l'left - len);
end if;
end read;
_______________________________________________
Ghdl-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/ghdl-discuss