mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
Fix unknown conversion on queues (#5220).
This commit is contained in:
+3
-5
@@ -469,20 +469,18 @@ class UnknownVisitor final : public VNVisitor {
|
||||
nodep->bitp()->cloneTreePure(false)};
|
||||
// Note below has null backp(); the Edit function knows how to deal with that.
|
||||
condp = V3Const::constifyEdit(condp);
|
||||
AstNodeDType* nodeDtp = nodep->dtypep()->skipRefp();
|
||||
if (condp->isOne()) {
|
||||
// We don't need to add a conditional; we know the existing expression is ok
|
||||
VL_DO_DANGLING(condp->deleteTree(), condp);
|
||||
} else if (!lvalue
|
||||
// Making a scalar would break if we're making an array
|
||||
&& !VN_IS(nodep->dtypep()->skipRefp(), NodeArrayDType)
|
||||
&& !(VN_IS(nodep->dtypep()->skipRefp(), NodeUOrStructDType)
|
||||
&& !VN_CAST(nodep->dtypep()->skipRefp(), NodeUOrStructDType)
|
||||
->packed())) {
|
||||
&& VN_IS(nodeDtp, BasicDType)) {
|
||||
// ARRAYSEL(...) -> COND(LT(bit<maxbit), ARRAYSEL(...), {width{1'bx}})
|
||||
VNRelinker replaceHandle;
|
||||
nodep->unlinkFrBack(&replaceHandle);
|
||||
V3Number xnum{nodep, nodep->width()};
|
||||
if (nodep->isString()) {
|
||||
if (nodeDtp->isString()) {
|
||||
xnum = V3Number{V3Number::String{}, nodep, ""};
|
||||
} else {
|
||||
xnum.setAllBitsX();
|
||||
|
||||
Reference in New Issue
Block a user