mirror of
https://github.com/verilator/verilator.git
synced 2026-09-05 00:41:39 +02:00
Fix error on case statement with all duplicate items, bug99.
This commit is contained in:
@@ -219,6 +219,7 @@ private:
|
||||
if (msb<0) {
|
||||
// There's no space for a IF. We know upperValue is thus down to a specific
|
||||
// exact value, so just return the tree value
|
||||
// Note can't clone here, as we're going to check for equivelence above
|
||||
return m_valueItem[upperValue];
|
||||
}
|
||||
else {
|
||||
@@ -284,6 +285,8 @@ private:
|
||||
|
||||
AstNode::user3ClearTree();
|
||||
AstNode* ifrootp = replaceCaseFastRecurse(cexprp, m_caseWidth-1, 0UL);
|
||||
// Case expressions can't be linked twice, so clone them
|
||||
if (ifrootp && !ifrootp->user3()) ifrootp = ifrootp->cloneTree(true);
|
||||
|
||||
if (ifrootp) nodep->replaceWith(ifrootp);
|
||||
else nodep->unlinkFrBack();
|
||||
|
||||
Reference in New Issue
Block a user