C#: Fix performance regression in cs/user-controlled-bypass

This commit is contained in:
Tom Hvitved
2019-03-14 10:36:01 +01:00
parent 01b8770b7c
commit 84c3073c2a

View File

@@ -57,11 +57,18 @@ module UserControlledBypassOfSensitiveMethod {
}
}
pragma[noinline]
private predicate conditionControlsCall0(
SensitiveExecutionMethodCall call, Expr e, ControlFlow::SuccessorTypes::BooleanSuccessor s
) {
forex(BasicBlock bb | bb = call.getAControlFlowNode().getBasicBlock() | e.controlsBlock(bb, s))
}
private predicate conditionControlsCall(
SensitiveExecutionMethodCall call, SensitiveExecutionMethod def, Expr e, boolean cond
) {
exists(ControlFlow::SuccessorTypes::BooleanSuccessor s | cond = s.getValue() |
e.controlsElement(call, s)
conditionControlsCall0(call, e, s)
) and
def = call.getTarget()
}