Fix error on case statement with all duplicate items, bug99.

This commit is contained in:
Wilson Snyder
2009-06-22 18:49:20 -04:00
parent 2aa618ce98
commit a32caac3c1
4 changed files with 104 additions and 0 deletions
+3
View File
@@ -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();