fhdl: fix implicit slice index
This commit is contained in:
parent
82f77180d5
commit
fab02f84cb
|
@ -72,6 +72,8 @@ class Value:
|
||||||
elif isinstance(key, slice):
|
elif isinstance(key, slice):
|
||||||
start = key.start or 0
|
start = key.start or 0
|
||||||
stop = key.stop or self.bv.width
|
stop = key.stop or self.bv.width
|
||||||
|
if stop > self.bv.width:
|
||||||
|
stop = self.bv.width
|
||||||
if key.step != None:
|
if key.step != None:
|
||||||
raise KeyError
|
raise KeyError
|
||||||
return Slice(self, start, stop)
|
return Slice(self, start, stop)
|
||||||
|
|
Loading…
Reference in New Issue