mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-27 08:38:03 +00:00
Fix args null in New
This commit is contained in:
parent
f5cc94316e
commit
3e64278624
@ -106,9 +106,11 @@ public class ExpressionGenerator extends DecafBaseVisitor<Expression> {
|
||||
public Expression visitNew(DecafParser.NewContext ctx) {
|
||||
Type type = ASTGenerator.getType(ctx.type());
|
||||
List<Expression> args = new ArrayList<>();
|
||||
for (var expr : ctx.args().expr()) {
|
||||
Expression astExpr = expr.accept(this);
|
||||
args.add(astExpr);
|
||||
if (ctx.args() != null) {
|
||||
for (var expr : ctx.args().expr()) {
|
||||
Expression astExpr = expr.accept(this);
|
||||
args.add(astExpr);
|
||||
}
|
||||
}
|
||||
return new New(type, args);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user