Skip to content

Commit

Permalink
- guard not null parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
whtoo committed Dec 5, 2023
1 parent 71b275e commit 1fc0c2a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ep20/src/main/java/org/teachfx/antlr4/ep20/ir/stmt/CJMP.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.teachfx.antlr4.ep20.ir.stmt;

import org.jetbrains.annotations.NotNull;
import org.teachfx.antlr4.ep20.ir.IRVisitor;
import org.teachfx.antlr4.ep20.ir.JMPInstr;
import org.teachfx.antlr4.ep20.ir.expr.VarSlot;
Expand All @@ -11,7 +12,7 @@ public class CJMP extends Stmt implements JMPInstr {
private LinearIRBlock elseBlock;


public CJMP(VarSlot cond, LinearIRBlock thenLabel, LinearIRBlock elseLabel) {
public CJMP(@NotNull VarSlot cond, @NotNull LinearIRBlock thenLabel,@NotNull LinearIRBlock elseLabel) {
this.cond = cond;
this.thenBlock = thenLabel;
this.elseBlock = elseLabel;
Expand Down
3 changes: 2 additions & 1 deletion ep20/src/main/java/org/teachfx/antlr4/ep20/ir/stmt/JMP.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.teachfx.antlr4.ep20.ir.stmt;

import org.jetbrains.annotations.NotNull;
import org.teachfx.antlr4.ep20.ir.IRVisitor;
import org.teachfx.antlr4.ep20.ir.JMPInstr;
import org.teachfx.antlr4.ep20.pass.cfg.LinearIRBlock;
Expand All @@ -11,7 +12,7 @@ public <S, E> S accept(IRVisitor<S, E> visitor) {
return visitor.visit(this);
}

public JMP(LinearIRBlock block)
public JMP(@NotNull LinearIRBlock block)
{
this.next = block;
block.refJMP(this);
Expand Down

0 comments on commit 1fc0c2a

Please sign in to comment.