Fix constant folding for multi-dimensional array pattern initialisation
This commit is contained in:
parent
0517a48688
commit
111998409b
|
|
@ -3026,6 +3026,12 @@ class ConstVisitor final : public VNVisitor {
|
|||
|
||||
void visit(AstArraySel* nodep) override {
|
||||
iterateAndNextNull(nodep->bitp());
|
||||
// Multi-dimensional param array access (fromp is a chain of ArraySels):
|
||||
// delegate to V3Simulate to natively handles InitArray chains
|
||||
if (m_required && VN_IS(nodep->fromp(), ArraySel)) {
|
||||
replaceWithSimulation(nodep);
|
||||
return;
|
||||
}
|
||||
if (VN_IS(nodep->bitp(), Const)
|
||||
&& VN_IS(nodep->fromp(), VarRef)
|
||||
// Need to make sure it's an array object so don't mis-allow a constant (bug509.)
|
||||
|
|
|
|||
Loading…
Reference in New Issue