Python points-to: Assorted tweaks to get nore tests passing.

This commit is contained in:
Mark Shannon
2019-04-11 18:08:13 +01:00
parent 3b42f3cea3
commit ec080419ba
9 changed files with 38 additions and 26 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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())
)
}

View File

@@ -6,7 +6,7 @@ from int size
where
size = count(ControlFlowNode f |
not PointsTo::Test::reachableBlock(f.getBasicBlock(), _)
not PointsToInternal::reachableBlock(f.getBasicBlock(), _)
)