Fix replicate of negative giving 'REPLICATE has no expected width' internal error (#6048).

This commit is contained in:
Wilson Snyder
2025-07-23 18:07:50 -04:00
parent 050e5ddb5b
commit 460bfbf181
8 changed files with 87 additions and 11 deletions
+1 -5
View File
@@ -1471,11 +1471,7 @@ V3Number& V3Number::opRepl(const V3Number& lhs,
// i op repl, L(i)*value(rhs) bit return
NUM_ASSERT_OP_ARGS1(lhs);
NUM_ASSERT_LOGIC_ARGS1(lhs);
if (rhsval > (1UL << 24)) {
v3error("More than a 16 Mbit replication, perhaps the replication factor"
" was two's-complement negative: "
<< rhsval << " (" << static_cast<int32_t>(rhsval) << ")");
} else if (rhsval > 8192) {
if (rhsval > 8192) {
v3warn(WIDTHCONCAT, "More than a 8k bit replication is probably wrong: " << rhsval);
}
setZero();