From 630e46e1fd7b53c151a68d6f31343b511121f3a2 Mon Sep 17 00:00:00 2001 From: Sauyon Lee Date: Wed, 18 Aug 2021 04:28:02 -0700 Subject: [PATCH] Exclude files with build constraints from the cfg test --- .../semmle/go/controlflow/ControlFlowGraph/CFG.expected | 4 ---- .../semmle/go/controlflow/ControlFlowGraph/CFG.ql | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ql/test/library-tests/semmle/go/controlflow/ControlFlowGraph/CFG.expected b/ql/test/library-tests/semmle/go/controlflow/ControlFlowGraph/CFG.expected index c4aee940eab..483f9e1b219 100644 --- a/ql/test/library-tests/semmle/go/controlflow/ControlFlowGraph/CFG.expected +++ b/ql/test/library-tests/semmle/go/controlflow/ControlFlowGraph/CFG.expected @@ -508,10 +508,6 @@ edges | hello.go:8:2:8:12 | selection of Println | hello.go:8:14:8:20 | message | | hello.go:8:2:8:21 | call to Println | hello.go:9:1:9:1 | exit | | hello.go:8:14:8:20 | message | hello.go:8:2:8:21 | call to Println | -| linux.go:0:0:0:0 | entry | linux.go:5:7:5:11 | skip | -| linux.go:5:7:5:11 | assignment to linux | linux.go:0:0:0:0 | exit | -| linux.go:5:7:5:11 | skip | linux.go:5:15:5:18 | true | -| linux.go:5:15:5:18 | true | linux.go:5:7:5:11 | assignment to linux | | main.go:0:0:0:0 | entry | main.go:3:1:6:1 | skip | | main.go:3:1:6:1 | skip | main.go:8:6:8:9 | skip | | main.go:8:1:8:1 | entry | main.go:9:9:9:20 | selection of Float64 | diff --git a/ql/test/library-tests/semmle/go/controlflow/ControlFlowGraph/CFG.ql b/ql/test/library-tests/semmle/go/controlflow/ControlFlowGraph/CFG.ql index 5db94a8ad39..c91a9dbaa2b 100644 --- a/ql/test/library-tests/semmle/go/controlflow/ControlFlowGraph/CFG.ql +++ b/ql/test/library-tests/semmle/go/controlflow/ControlFlowGraph/CFG.ql @@ -3,6 +3,8 @@ import go query predicate nodes(ControlFlow::Node nd) { none() } query predicate edges(ControlFlow::Node pred, ControlFlow::Node succ) { + not succ.getFile().hasBuildConstraints() and + not pred.getFile().hasBuildConstraints() and succ = pred.getASuccessor() }