mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Java 17: exclude non-source locations in some tests
This commit is contained in:
@@ -3,5 +3,5 @@ import semmle.code.java.dataflow.ModulusAnalysis
|
||||
import semmle.code.java.dataflow.Bound
|
||||
|
||||
from Expr e, Bound b, int delta, int mod
|
||||
where exprModulus(e, b, delta, mod)
|
||||
where exprModulus(e, b, delta, mod) and e.getCompilationUnit().fromSource()
|
||||
select e, b.toString(), delta, mod
|
||||
|
||||
@@ -8,5 +8,5 @@ private string getDirectionString(boolean d) {
|
||||
}
|
||||
|
||||
from Expr e, Bound b, int delta, boolean upper, Reason reason
|
||||
where bounded(e, b, delta, upper, reason)
|
||||
where bounded(e, b, delta, upper, reason) and e.getCompilationUnit().fromSource()
|
||||
select e, b.toString(), delta, getDirectionString(upper), reason
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
import semmle.code.java.Expr
|
||||
|
||||
class SrcFloatingPointLiteral extends FloatLiteral {
|
||||
SrcFloatingPointLiteral() {
|
||||
this.getCompilationUnit().fromSource()
|
||||
}
|
||||
}
|
||||
|
||||
from FloatLiteral lit
|
||||
select lit, lit.getValue(), lit.getFloatValue()
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
import semmle.code.java.Expr
|
||||
|
||||
from IntegerLiteral lit
|
||||
class SrcIntegerLiteral extends IntegerLiteral {
|
||||
SrcIntegerLiteral() {
|
||||
this.getCompilationUnit().fromSource()
|
||||
}
|
||||
}
|
||||
|
||||
from SrcIntegerLiteral lit
|
||||
select lit, lit.getValue(), lit.getIntValue()
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
import java
|
||||
|
||||
from Literal l
|
||||
class SrcLiteral extends Literal {
|
||||
SrcLiteral() {
|
||||
this.getCompilationUnit().fromSource()
|
||||
}
|
||||
}
|
||||
|
||||
from SrcLiteral l
|
||||
where
|
||||
l instanceof IntegerLiteral or
|
||||
l instanceof LongLiteral or
|
||||
|
||||
Reference in New Issue
Block a user