hdl.ast: allow slicing [n:n] into n-bit value.
This commit is contained in:
parent
ef1e0b8d55
commit
a2b04d71d0
|
@ -361,7 +361,7 @@ class Slice(Value):
|
|||
raise TypeError("Slice end must be an integer, not '{!r}'".format(end))
|
||||
|
||||
n = len(value)
|
||||
if start not in range(-n, n):
|
||||
if start not in range(-(n+1), n+1):
|
||||
raise IndexError("Cannot start slice {} bits into {}-bit value".format(start, n))
|
||||
if start < 0:
|
||||
start += n
|
||||
|
|
Loading…
Reference in a new issue