mirror of
https://github.com/github/codeql.git
synced 2026-04-25 08:45:14 +02:00
Shared/Java: Make the 'isNull' interface slightly prettier.
This commit is contained in:
@@ -42,6 +42,12 @@ signature module TypeFlowInput<LocationSig Location> {
|
||||
/** Holds if `n` represents a `null` value. */
|
||||
predicate isNullValue(TypeFlowNode n);
|
||||
|
||||
/**
|
||||
* Holds if `n` should be excluded from the set of null values even if
|
||||
* the null analysis determines that `n` is always null.
|
||||
*/
|
||||
default predicate isExcludedFromNullAnalysis(TypeFlowNode n) { none() }
|
||||
|
||||
/** A type. */
|
||||
class Type {
|
||||
/** Gets a textual representation of this type. */
|
||||
|
||||
@@ -10,6 +10,9 @@ module TypeFlow<LocationSig Location, TypeFlowInput<Location> I> {
|
||||
isNullValue(n)
|
||||
or
|
||||
exists(TypeFlowNode mid | isNull(mid) and step(mid, n))
|
||||
or
|
||||
forex(TypeFlowNode mid | I::joinStep(mid, n) | isNull(mid)) and
|
||||
not isExcludedFromNullAnalysis(n)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user