mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C#/Ruby: Replace cached with nomagic for deprecated predicates.
This commit is contained in:
@@ -794,6 +794,15 @@ deprecated private predicate lastRefSkipUncertainReads(
|
||||
)
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
deprecated predicate lastReadSameVar(Definition def, ControlFlow::Node cfn) {
|
||||
exists(ControlFlow::BasicBlock bb, int i |
|
||||
lastRefSkipUncertainReads(def, bb, i) and
|
||||
variableReadActual(bb, i, _) and
|
||||
cfn = bb.getNode(i)
|
||||
)
|
||||
}
|
||||
|
||||
cached
|
||||
private module Cached {
|
||||
cached
|
||||
@@ -957,15 +966,6 @@ private module Cached {
|
||||
)
|
||||
}
|
||||
|
||||
cached
|
||||
deprecated predicate lastReadSameVar(Definition def, ControlFlow::Node cfn) {
|
||||
exists(ControlFlow::BasicBlock bb, int i |
|
||||
lastRefSkipUncertainReads(def, bb, i) and
|
||||
variableReadActual(bb, i, _) and
|
||||
cfn = bb.getNode(i)
|
||||
)
|
||||
}
|
||||
|
||||
cached
|
||||
Definition uncertainWriteDefinitionInput(UncertainWriteDefinition def) {
|
||||
Impl::uncertainWriteDefinitionInput(def, result)
|
||||
|
||||
@@ -302,6 +302,20 @@ deprecated private predicate lastRefSkipUncertainReadsExt(
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the read of `def` at `read` may be a last read. That is, `read`
|
||||
* can either reach another definition of the underlying source variable or
|
||||
* the end of the CFG scope, without passing through another non-pseudo read.
|
||||
*/
|
||||
pragma[nomagic]
|
||||
deprecated predicate lastRead(Definition def, VariableReadAccessCfgNode read) {
|
||||
exists(Cfg::BasicBlock bb, int i |
|
||||
lastRefSkipUncertainReadsExt(def, bb, i) and
|
||||
variableReadActual(bb, i, _) and
|
||||
read = bb.getNode(i)
|
||||
)
|
||||
}
|
||||
|
||||
cached
|
||||
private module Cached {
|
||||
/**
|
||||
@@ -401,20 +415,6 @@ private module Cached {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the read of `def` at `read` may be a last read. That is, `read`
|
||||
* can either reach another definition of the underlying source variable or
|
||||
* the end of the CFG scope, without passing through another non-pseudo read.
|
||||
*/
|
||||
cached
|
||||
deprecated predicate lastRead(Definition def, VariableReadAccessCfgNode read) {
|
||||
exists(Cfg::BasicBlock bb, int i |
|
||||
lastRefSkipUncertainReadsExt(def, bb, i) and
|
||||
variableReadActual(bb, i, _) and
|
||||
read = bb.getNode(i)
|
||||
)
|
||||
}
|
||||
|
||||
cached
|
||||
Definition uncertainWriteDefinitionInput(UncertainWriteDefinition def) {
|
||||
Impl::uncertainWriteDefinitionInput(def, result)
|
||||
|
||||
Reference in New Issue
Block a user