mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Fix multidimensional function return value selects (#5382).
This commit is contained in:
@@ -128,6 +128,23 @@ AstRange* V3ParseGrammar::scrubRange(AstNodeRange* nrangep) {
|
||||
return VN_CAST(nrangep, Range);
|
||||
}
|
||||
|
||||
AstNodePreSel* V3ParseGrammar::scrubSel(AstNodeExpr* fromp, AstNodePreSel* selp) VL_MT_DISABLED {
|
||||
// SEL(PARSELVALUE, ...) -> SEL(fromp, ...)
|
||||
AstNodePreSel* subSelp = selp;
|
||||
while (true) {
|
||||
if (VN_IS(subSelp->fromp(), ParseHolder)) break;
|
||||
if (AstNodePreSel* const lowerSelp = VN_CAST(subSelp->fromp(), NodePreSel)) {
|
||||
subSelp = lowerSelp;
|
||||
continue;
|
||||
}
|
||||
subSelp->v3fatalSrc("Couldn't find where to insert expression into select");
|
||||
}
|
||||
AstNode* subSelFromp = subSelp->fromp();
|
||||
subSelFromp->replaceWith(fromp);
|
||||
VL_DO_DANGLING(subSelFromp->deleteTree(), subSelFromp);
|
||||
return selp;
|
||||
}
|
||||
|
||||
AstNodeDType* V3ParseGrammar::createArray(AstNodeDType* basep, AstNodeRange* nrangep,
|
||||
bool isPacked) {
|
||||
// Split RANGE0-RANGE1-RANGE2
|
||||
|
||||
Reference in New Issue
Block a user