Java/Kotlin: Add a consistency query for BinaryExpr

This commit is contained in:
Ian Lynagh
2021-11-16 16:32:12 +00:00
parent 9e2a3a9da8
commit 90365c9c58

View File

@@ -0,0 +1,8 @@
import java
from BinaryExpr be, string reason
where not exists(be.getLeftOperand()) and reason = "No left operand"
or not exists(be.getRightOperand()) and reason = "No right operand"
or exists(Expr e, int i | e.isNthChildOf(be, i) and i != 0 and i != 1 and reason = "Unexpected operand " + i.toString())
or be.getOp() = " ?? " and reason = "No operator name"
select be, reason