C#: Use guards library

This commit is contained in:
Calum Grant
2020-01-15 15:46:19 +00:00
parent 41b4d70504
commit 6790028d4c

View File

@@ -13,16 +13,16 @@
*/
import semmle.code.csharp.serialization.Serialization
import semmle.code.csharp.controlflow.Guards
/**
* The result is a write to the field `f`, assigning it the value
* of variable `v` which was checked by the condition `check`.
*/
Expr checkedWrite(Field f, Variable v, IfStmt check) {
GuardedExpr checkedWrite(Field f, Variable v, IfStmt check) {
result = v.getAnAccess() and
result = f.getAnAssignedValue() and
check.getCondition() = v.getAnAccess().getParent*() and
result.getAControlFlowNode() = check.getAControlFlowNode().getASuccessor*()
check.getCondition().getAChildExpr*() = result.getAGuard(_, _)
}
/**