Merge pull request #483 from owen-mc/sync-dataflow-libraries

Sync dataflow libraries
This commit is contained in:
Sauyon Lee
2021-02-25 11:40:50 -08:00
committed by GitHub
7 changed files with 3601 additions and 2693 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -802,14 +802,9 @@ abstract class AccessPathFront extends TAccessPathFront {
abstract boolean toBoolNonEmpty();
predicate headUsesContent(TypedContent tc) { this = TFrontHead(tc) }
TypedContent getHead() { this = TFrontHead(result) }
predicate isClearedAt(Node n) {
exists(TypedContent tc |
this.headUsesContent(tc) and
clearsContent(n, tc.getContent())
)
}
predicate isClearedAt(Node n) { clearsContent(n, getHead().getContent()) }
}
class AccessPathFrontNil extends AccessPathFront, TFrontNil {

View File

@@ -243,6 +243,15 @@ predicate isUnreachableInCall(Node n, DataFlowCall call) {
int accessPathLimit() { result = 5 }
/** The unit type. */
private newtype TUnit = TMkUnit()
/** The trivial type with a single element. */
class Unit extends TUnit {
/** Gets a textual representation of this element. */
string toString() { result = "unit" }
}
/**
* Gets the `i`th argument of call `c`, where the receiver of a method call
* counts as argument -1.

View File

@@ -186,7 +186,7 @@ abstract class DefaultTaintSanitizer extends DataFlow::Node { }
* Holds if `node` should be a sanitizer in all global taint flow configurations
* but not in local taint.
*/
predicate isDefaultTaintSanitizer(DataFlow::Node node) { node instanceof DefaultTaintSanitizer }
predicate defaultTaintSanitizer(DataFlow::Node node) { node instanceof DefaultTaintSanitizer }
/**
* A sanitizer guard in all global taint flow configurations but not in local taint.
@@ -197,7 +197,7 @@ abstract class DefaultTaintSanitizerGuard extends DataFlow::BarrierGuard { }
* Holds if `guard` should be a sanitizer guard in all global taint flow configurations
* but not in local taint.
*/
predicate isDefaultTaintSanitizerGuard(DataFlow::BarrierGuard guard) {
predicate defaultTaintSanitizerGuard(DataFlow::BarrierGuard guard) {
guard instanceof DefaultTaintSanitizerGuard
}

View File

@@ -76,7 +76,7 @@ abstract class Configuration extends DataFlow::Configuration {
final override predicate isBarrier(DataFlow::Node node) {
isSanitizer(node) or
isDefaultTaintSanitizer(node)
defaultTaintSanitizer(node)
}
/** Holds if taint propagation into `node` is prohibited. */
@@ -93,7 +93,7 @@ abstract class Configuration extends DataFlow::Configuration {
predicate isSanitizerGuard(DataFlow::BarrierGuard guard) { none() }
final override predicate isBarrierGuard(DataFlow::BarrierGuard guard) {
isSanitizerGuard(guard) or isDefaultTaintSanitizerGuard(guard)
isSanitizerGuard(guard) or defaultTaintSanitizerGuard(guard)
}
/**

View File

@@ -76,7 +76,7 @@ abstract class Configuration extends DataFlow::Configuration {
final override predicate isBarrier(DataFlow::Node node) {
isSanitizer(node) or
isDefaultTaintSanitizer(node)
defaultTaintSanitizer(node)
}
/** Holds if taint propagation into `node` is prohibited. */
@@ -93,7 +93,7 @@ abstract class Configuration extends DataFlow::Configuration {
predicate isSanitizerGuard(DataFlow::BarrierGuard guard) { none() }
final override predicate isBarrierGuard(DataFlow::BarrierGuard guard) {
isSanitizerGuard(guard) or isDefaultTaintSanitizerGuard(guard)
isSanitizerGuard(guard) or defaultTaintSanitizerGuard(guard)
}
/**