mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Fix assignment of null into struct member (#4952).
This commit is contained in:
+3
-2
@@ -82,7 +82,8 @@ class CastVisitor final : public VNVisitor {
|
||||
}
|
||||
void ensureCast(AstNodeExpr* nodep) {
|
||||
if (castSize(nodep->backp()) != castSize(nodep) || !nodep->user1()) {
|
||||
insertCast(nodep, castSize(nodep->backp()));
|
||||
const AstConst* const constp = VN_CAST(nodep, Const);
|
||||
if (!(constp && constp->num().isNull())) insertCast(nodep, castSize(nodep->backp()));
|
||||
}
|
||||
}
|
||||
void ensureLower32Cast(AstCCast* nodep) {
|
||||
@@ -201,7 +202,7 @@ class CastVisitor final : public VNVisitor {
|
||||
// Constants are of unknown size if smaller than 33 bits, because
|
||||
// we're too lazy to wrap every constant in the universe in
|
||||
// ((IData)#).
|
||||
nodep->user1(nodep->isQuad() || nodep->isWide());
|
||||
nodep->user1(nodep->isQuad() || nodep->isWide() || nodep->num().isNull());
|
||||
}
|
||||
|
||||
// Null dereference protection
|
||||
|
||||
Reference in New Issue
Block a user