Fix bad code when tracing array of structs, bug1122.

This commit is contained in:
Wilson Snyder
2017-01-06 18:44:37 -05:00
parent 663b2be065
commit 2f34132275
5 changed files with 57 additions and 2 deletions
+6 -1
View File
@@ -1435,7 +1435,12 @@ private:
if (!m_selp) {
nodep->v3error("Illegal assignment of constant to unpacked array");
} else {
nodep->replaceWith(nodep->fromp()->unlinkFrBack());
AstNode* fromp = nodep->fromp()->unlinkFrBack();
nodep->replaceWith(fromp);
if (fromp->dtypep()->skipRefp()->castNodeArrayDType()) {
// Strip off array to find what array references
fromp->dtypeFrom(fromp->dtypep()->skipRefp()->castNodeArrayDType()->subDTypep());
}
}
}
m_selp = NULL;