Skip to content

Commit 769b3a6

Browse files
committed
Instantiate flow barrier guards from MaD
1 parent 7d65bac commit 769b3a6

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

rust/ql/lib/codeql/rust/dataflow/internal/ModelsAsData.qll

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,24 @@ private class FlowBarrierFromModel extends FlowBarrier::Range {
256256
}
257257
}
258258

259+
private class FlowBarrierGuardFromModel extends FlowBarrierGuard::Range {
260+
private string path;
261+
262+
FlowBarrierGuardFromModel() {
263+
barrierGuardModel(path, _, _, _, _, _) and
264+
this.callResolvesTo(path)
265+
}
266+
267+
override predicate isBarrierGuard(
268+
string input, string branch, string kind, Provenance provenance, string model
269+
) {
270+
exists(QlBuiltins::ExtensionId madId |
271+
barrierGuardModel(path, input, branch, kind, provenance, madId) and
272+
model = "MaD:" + madId.toString()
273+
)
274+
}
275+
}
276+
259277
private module Debug {
260278
private import FlowSummaryImpl
261279
private import Private

0 commit comments

Comments
 (0)