mirror of
https://github.com/github/codeql.git
synced 2026-05-03 04:39:29 +02:00
more consistent naming of predicates
This commit is contained in:
@@ -98,14 +98,22 @@ predicate maybeAccessesProperty(Expr e, string name) {
|
||||
*/
|
||||
predicate isDeadAssignment(string name, DataFlow::PropWrite assign1, DataFlow::PropWrite assign2) {
|
||||
(
|
||||
assign2.getWriteNode() = getANodeWithNoPropAccessBetweenInsideBlock(name, assign1) and
|
||||
postDominatedPropWrite(name, assign1, assign2, true)
|
||||
or
|
||||
noPropAccessBetweenGlobal(name, assign1, assign2)
|
||||
noPropAccessBetweenInsideBasicBlock(name, assign1, assign2) or
|
||||
noPropAccessBetweenAcrossBasicBlocks(name, assign1, assign2)
|
||||
) and
|
||||
not isDOMProperty(name)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `assign1` and `assign2` are in the same basicblock and both assign property `name`, and the assigned property is not accessed between the two assignments.
|
||||
*/
|
||||
predicate noPropAccessBetweenInsideBasicBlock(
|
||||
string name, DataFlow::PropWrite assign1, DataFlow::PropWrite assign2
|
||||
) {
|
||||
assign2.getWriteNode() = getANodeWithNoPropAccessBetweenInsideBlock(name, assign1) and
|
||||
postDominatedPropWrite(name, assign1, assign2, true)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `assign` assigns a property that may be accessed somewhere else in the same block,
|
||||
* `after` indicates if the access happens before or after the node for `assign`.
|
||||
@@ -234,7 +242,7 @@ ControlFlowNode getANodeWithNoPropAccessBetweenInsideBlock(string name, DataFlow
|
||||
* Holds if `assign1` and `assign2` are in different basicblocks and both assign property `name`, and the assigned property is not accessed between the two assignments.
|
||||
*/
|
||||
pragma[nomagic]
|
||||
predicate noPropAccessBetweenGlobal(
|
||||
predicate noPropAccessBetweenAcrossBasicBlocks(
|
||||
string name, DataFlow::PropWrite assign1, DataFlow::PropWrite assign2
|
||||
) {
|
||||
exists(
|
||||
|
||||
Reference in New Issue
Block a user