Internals: resolved incorrect array bounds guarding (#8224)

Co-authored-by: Sumanth Kadiyala <[email protected]>
This commit is contained in:
Sumanth Kadiyala
2026-09-05 15:33:06 -04:00
committed by GitHub
co-authored by Sumanth Kadiyala
parent d04647f459
commit 3990376c57
4 changed files with 96 additions and 3 deletions
+1 -1
View File
@@ -146,7 +146,7 @@ class UnknownVisitor final : public VNVisitor {
// Returns true if it is known at compile time that `msbConstp` is greater than or equal
// `exprp`
static bool isStaticlyGte(AstConst* const msbConstp, const AstNodeExpr* const exprp) {
if (msbConstp->width() >= exprp->width()
if (msbConstp->width() >= exprp->width() && exprp->width() < 32
&& msbConstp->num().toSInt() >= (1 << exprp->width()) - 1) {
return true;
}