1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-12-26 18:29:54 +00:00

Fixed NPE

This commit is contained in:
jespergravgaard 2017-10-23 01:22:36 +02:00
parent 471117561b
commit cd2c50b8a8

View File

@ -188,9 +188,11 @@ public class Pass1GenerateStatementSequence extends KickCBaseVisitor<Object> {
this.visit(stmtForCtx.stmt()); this.visit(stmtForCtx.stmt());
} }
// Add increment // Add increment
PrePostModifierHandler.addPreModifiers(this, ctx.expr(1)); if(ctx.expr(1)!=null) {
this.visit(ctx.expr(1)); PrePostModifierHandler.addPreModifiers(this, ctx.expr(1));
PrePostModifierHandler.addPostModifiers(this, ctx.expr(1)); this.visit(ctx.expr(1));
PrePostModifierHandler.addPostModifiers(this, ctx.expr(1));
}
// Add condition // Add condition
PrePostModifierHandler.addPreModifiers(this, ctx.expr(0)); PrePostModifierHandler.addPreModifiers(this, ctx.expr(0));
RValue rValue = (RValue) this.visit(ctx.expr(0)); RValue rValue = (RValue) this.visit(ctx.expr(0));