mirror of
https://github.com/github/codeql.git
synced 2025-12-21 19:26:31 +01:00
Python points-to: Assorted tweaks to get nore tests passing.
This commit is contained in:
@@ -9,15 +9,15 @@ import semmle.python.pointsto.PointsToContext
|
||||
|
||||
from int total_facts, int total_size, int depth, float efficiency
|
||||
where
|
||||
total_facts = strictcount(ControlFlowNode call, FunctionObject func |
|
||||
total_facts = strictcount(ControlFlowNode call, CallableValue func |
|
||||
exists(PointsToContext ctx |
|
||||
call = PointsTo::get_a_call(func, ctx) and
|
||||
call = func.getACall(ctx) and
|
||||
depth = ctx.getDepth()
|
||||
)
|
||||
)
|
||||
and
|
||||
total_size = strictcount(ControlFlowNode call, FunctionObject func, PointsToContext ctx |
|
||||
call = PointsTo::get_a_call(func, ctx) and
|
||||
total_size = strictcount(ControlFlowNode call, CallableValue func, PointsToContext ctx |
|
||||
call = func.getACall(ctx) and
|
||||
depth = ctx.getDepth()
|
||||
)
|
||||
and
|
||||
|
||||
@@ -8,20 +8,20 @@ import semmle.python.pointsto.PointsToContext
|
||||
|
||||
from int total_facts, int total_size, int depth, float efficiency
|
||||
where
|
||||
total_facts = strictcount(ControlFlowNode call, FunctionObject func |
|
||||
total_facts = strictcount(ControlFlowNode call, CallableValue func |
|
||||
exists(PointsToContext ctx |
|
||||
call = PointsTo::get_a_call(func, ctx) and
|
||||
call = func.getACall(ctx) and
|
||||
depth = ctx.getDepth()
|
||||
and not
|
||||
exists(PointsToContext shallower |
|
||||
call = PointsTo::get_a_call(func, shallower) and
|
||||
call = func.getACall(shallower) and
|
||||
shallower.getDepth() < depth
|
||||
)
|
||||
)
|
||||
)
|
||||
and
|
||||
total_size = strictcount(ControlFlowNode call, FunctionObject func, PointsToContext ctx |
|
||||
call = PointsTo::get_a_call(func, ctx) and
|
||||
total_size = strictcount(ControlFlowNode call, CallableValue func, PointsToContext ctx |
|
||||
call = func.getACall(ctx) and
|
||||
depth = ctx.getDepth()
|
||||
)
|
||||
and
|
||||
|
||||
@@ -12,7 +12,7 @@ import python
|
||||
predicate points_to_failure(Expr e) {
|
||||
exists(ControlFlowNode f |
|
||||
f = e.getAFlowNode() |
|
||||
not f.refersTo(_)
|
||||
not exists(f.pointsTo())
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from int size
|
||||
|
||||
where
|
||||
size = count(ControlFlowNode f |
|
||||
not PointsTo::Test::reachableBlock(f.getBasicBlock(), _)
|
||||
not PointsToInternal::reachableBlock(f.getBasicBlock(), _)
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user