3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-09-30 13:19:05 +00:00

Merge pull request #5382 from rocallahan/fix-bounds-check

Fix off-by-one error in bounds check in `RTLIL::SigChunk::operator[]`
This commit is contained in:
Jannis Harder 2025-09-24 08:41:16 +02:00 committed by GitHub
commit 9c1d0a2346
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4399,7 +4399,7 @@ RTLIL::SigChunk RTLIL::SigChunk::extract(int offset, int length) const
RTLIL::SigBit RTLIL::SigChunk::operator[](int offset) const RTLIL::SigBit RTLIL::SigChunk::operator[](int offset) const
{ {
log_assert(offset >= 0); log_assert(offset >= 0);
log_assert(offset <= width); log_assert(offset < width);
RTLIL::SigBit ret; RTLIL::SigBit ret;
if (wire) { if (wire) {
ret.wire = wire; ret.wire = wire;