mirror of
https://github.com/github/codeql.git
synced 2026-01-29 22:32:58 +01:00
run the redundant-cast patch
This commit is contained in:
@@ -652,7 +652,7 @@ module CFG {
|
||||
|
||||
AtomicTree() {
|
||||
exists(Expr e |
|
||||
e = this.(Expr) and
|
||||
e = this and
|
||||
e.isConst() and
|
||||
nd = mkExprOrSkipNode(this)
|
||||
|
|
||||
|
||||
@@ -289,7 +289,7 @@ private predicate isPossibleInputNode(DataFlow::Node inputNode, FuncDef fd) {
|
||||
private ControlFlow::Node getANonTestPassingPredecessor(
|
||||
ControlFlow::Node succ, DataFlow::Node inputNode
|
||||
) {
|
||||
isPossibleInputNode(inputNode, succ.getRoot().(FuncDef)) and
|
||||
isPossibleInputNode(inputNode, succ.getRoot()) and
|
||||
result = succ.getAPredecessor() and
|
||||
not exists(Expr testExpr, DataFlow::Node switchExprNode |
|
||||
flowsToSwitchExpression(inputNode, switchExprNode) and
|
||||
@@ -301,7 +301,7 @@ private ControlFlow::Node getANonTestPassingPredecessor(
|
||||
private ControlFlow::Node getANonTestPassingReachingNodeRecursive(
|
||||
ControlFlow::Node n, DataFlow::Node inputNode
|
||||
) {
|
||||
isPossibleInputNode(inputNode, n.getRoot().(FuncDef)) and
|
||||
isPossibleInputNode(inputNode, n.getRoot()) and
|
||||
(
|
||||
result = n or
|
||||
result =
|
||||
@@ -328,7 +328,7 @@ private ControlFlow::Node getANonTestPassingReachingNodeBase(
|
||||
private predicate mustPassConstantCaseTestToReach(
|
||||
IR::ReturnInstruction ret, DataFlow::Node inputNode
|
||||
) {
|
||||
isPossibleInputNode(inputNode, ret.getRoot().(FuncDef)) and
|
||||
isPossibleInputNode(inputNode, ret.getRoot()) and
|
||||
not exists(ControlFlow::Node entry | entry = ret.getRoot().getEntryNode() |
|
||||
entry = getANonTestPassingReachingNodeBase(ret, inputNode)
|
||||
)
|
||||
|
||||
@@ -47,10 +47,10 @@ predicate callGraphEdge(CallGraphNode pred, CallGraphNode succ) {
|
||||
pred.(CallExpr) = succ.(FuncDef).getACall().asExpr()
|
||||
or
|
||||
// Go from a function to an enclosed loop.
|
||||
pred.(FuncDef) = succ.(LoopStmt).getEnclosingFunction()
|
||||
pred = succ.(LoopStmt).getEnclosingFunction()
|
||||
or
|
||||
// Go from a function to an enclosed call.
|
||||
pred.(FuncDef) = succ.(CallExpr).getEnclosingFunction()
|
||||
pred = succ.(CallExpr).getEnclosingFunction()
|
||||
}
|
||||
|
||||
query predicate edges(CallGraphNode pred, CallGraphNode succ) {
|
||||
|
||||
@@ -535,8 +535,7 @@ float getAnSsaLowerBound(SsaDefinition def) {
|
||||
predicate ssaDependsOnSsa(SsaDefinition nextDef, SsaDefinition prevDef) {
|
||||
//SSA definition coresponding to a `SimpleAssignStmt`
|
||||
exists(SimpleAssignStmt simpleAssign, int i |
|
||||
nextDef.(SsaExplicitDefinition).getInstruction().(IR::AssignInstruction) =
|
||||
IR::assignInstruction(simpleAssign, i) and
|
||||
nextDef.(SsaExplicitDefinition).getInstruction() = IR::assignInstruction(simpleAssign, i) and
|
||||
ssaDependsOnExpr(prevDef, simpleAssign.getRhs())
|
||||
)
|
||||
or
|
||||
|
||||
Reference in New Issue
Block a user