[ClangAstParser] Processes NullNode for VariableArrayType
@@ -30,6 +30,7 @@ import pt.up.fe.specs.clava.ast.extra.NullNode;
import pt.up.fe.specs.clava.ast.extra.Undefined;
import pt.up.fe.specs.clava.ast.type.DependentSizedArrayType;
import pt.up.fe.specs.clava.ast.type.Type;
+import pt.up.fe.specs.clava.ast.type.VariableArrayType;
import pt.up.fe.specs.clava.utils.Typable;
import pt.up.fe.specs.util.SpecsLogs;
import pt.up.fe.specs.util.SpecsSystem;
@@ -305,6 +306,14 @@ public class NewClavaNodeParser<T extends ClavaNode> extends AClangNodeParser<T>
return;
}
+ if (clavaNode instanceof VariableArrayType) {
+ Preconditions.checkArgument(children.size() > 1);
+ if (children.get(1) instanceof NullNode) {
+ children.set(1, LegacyToDataStore.getFactory().nullExpr());
+ }
+ return;
+ }
+
throw new RuntimeException("NullNode not being handled in class " + clavaNode.getClass());
}
