From fab02f84cbb9ee5d790023aeec4667261568bf87 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Wed, 7 Dec 2011 22:21:30 +0100 Subject: [PATCH] fhdl: fix implicit slice index --- migen/fhdl/structure.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/migen/fhdl/structure.py b/migen/fhdl/structure.py index 16fa1ee8..4116c889 100644 --- a/migen/fhdl/structure.py +++ b/migen/fhdl/structure.py @@ -72,6 +72,8 @@ class Value: elif isinstance(key, slice): start = key.start or 0 stop = key.stop or self.bv.width + if stop > self.bv.width: + stop = self.bv.width if key.step != None: raise KeyError return Slice(self, start, stop) -- 2.30.2