Fix AstStructSel clean when data type is structure (#4241) (#4244)

This commit is contained in:
Risto Pejašinović 2023-05-31 05:44:48 +02:00 committed by GitHub
parent 4f1f487ae4
commit 338acabe2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -234,6 +234,11 @@ private:
operandTriop(nodep);
setClean(nodep, nodep->cleanOut());
}
void visit(AstStructSel* nodep) override {
iterateChildren(nodep);
AstStructDType* dtypep = VN_CAST(nodep->dtypep()->skipRefp(), StructDType);
setClean(nodep, dtypep && !dtypep->packed());
}
void visit(AstUCFunc* nodep) override {
iterateChildren(nodep);
computeCppWidth(nodep);

View File

@ -38,9 +38,8 @@ module t;
assign s2.arr[1] = 8'h33;
initial begin
if(s1 != s2) begin
$fatal;
end
if(s1 != s2) $stop;
if(s1.sub != s2.sub) $stop;
if(s1 == s2) begin
$write("*-* All Finished *-*\n");
$finish;