From 77cb35380c6d28af2a1027e4446f565007d269d4 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 17 Mar 2026 11:10:25 +0000 Subject: [PATCH] Add MaD barrier guard model to make test pass --- .../test/library-tests/dataflow/barrier/inline-flow.ext.yml | 5 +++++ rust/ql/test/library-tests/dataflow/barrier/main.rs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rust/ql/test/library-tests/dataflow/barrier/inline-flow.ext.yml b/rust/ql/test/library-tests/dataflow/barrier/inline-flow.ext.yml index 98c62dd0758..58e55a040d2 100644 --- a/rust/ql/test/library-tests/dataflow/barrier/inline-flow.ext.yml +++ b/rust/ql/test/library-tests/dataflow/barrier/inline-flow.ext.yml @@ -4,3 +4,8 @@ extensions: extensible: barrierModel data: - ["main::sanitize", "ReturnValue", "test-barrier", "manual"] + - addsTo: + pack: codeql/rust-all + extensible: barrierGuardModel + data: + - ["main::verify_safe", "Argument[0]", "true", "test-barrier", "manual"] diff --git a/rust/ql/test/library-tests/dataflow/barrier/main.rs b/rust/ql/test/library-tests/dataflow/barrier/main.rs index 6cf317d105a..268a8673bc9 100644 --- a/rust/ql/test/library-tests/dataflow/barrier/main.rs +++ b/rust/ql/test/library-tests/dataflow/barrier/main.rs @@ -43,6 +43,6 @@ fn verify_safe(s: &str) -> bool { fn with_barrier_guard() { let s = source(1); if verify_safe(s) { - sink(s); // $ SPURIOUS: hasValueFlow=1 + sink(s); } }