Fix internal error on out-of-bounds real array access.

This commit is contained in:
Wilson Snyder
2025-09-16 08:18:51 -04:00
parent 2b3bf5f51d
commit 9187b4d552
5 changed files with 63 additions and 1 deletions
+4 -1
View File
@@ -484,8 +484,11 @@ class UnknownVisitor final : public VNVisitor {
// ARRAYSEL(...) -> COND(LT(bit<maxbit), ARRAYSEL(...), {width{1'bx}})
VNRelinker replaceHandle;
nodep->unlinkFrBack(&replaceHandle);
// TODO make a tieoff function that takes AstNode and returns typed value
V3Number xnum{nodep, nodep->width()};
if (nodeDtp->isString()) {
if (nodeDtp->isDouble()) {
xnum = V3Number{V3Number::Double{}, nodep, 0.0};
} else if (nodeDtp->isString()) {
xnum = V3Number{V3Number::String{}, nodep, ""};
} else {
xnum.setAllBitsX();