Skip to content

Commit 490df20

Browse files
committed
Dataflow: Add language-specific predicate forceHighPrecision().
1 parent d4f1a96 commit 490df20

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowPrivate.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,12 @@ predicate isUnreachableInCall(Node n, DataFlowCall call) { none() } // stub impl
240240

241241
int accessPathLimit() { result = 5 }
242242

243+
/**
244+
* Holds if accesspaths with `c` at their head always should be tracked at high
245+
* precision. This disables adaptive accesspath precision for such accesspaths.
246+
*/
247+
predicate forceHighPrecision(Content c) { none() }
248+
243249
/** The unit type. */
244250
private newtype TUnit = TMkUnit()
245251

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,12 @@ predicate isUnreachableInCall(Node n, DataFlowCall call) { none() } // stub impl
466466

467467
int accessPathLimit() { result = 5 }
468468

469+
/**
470+
* Holds if accesspaths with `c` at their head always should be tracked at high
471+
* precision. This disables adaptive accesspath precision for such accesspaths.
472+
*/
473+
predicate forceHighPrecision(Content c) { none() }
474+
469475
/** The unit type. */
470476
private newtype TUnit = TMkUnit()
471477

csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,6 +1918,12 @@ private predicate viableConstantBooleanParamArg(
19181918

19191919
int accessPathLimit() { result = 5 }
19201920

1921+
/**
1922+
* Holds if accesspaths with `c` at their head always should be tracked at high
1923+
* precision. This disables adaptive accesspath precision for such accesspaths.
1924+
*/
1925+
predicate forceHighPrecision(Content c) { c instanceof ElementContent }
1926+
19211927
/** The unit type. */
19221928
private newtype TUnit = TMkUnit()
19231929

python/ql/lib/semmle/python/dataflow/new/internal/DataFlowPrivate.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,6 +1620,12 @@ predicate isImmutableOrUnobservable(Node n) { none() }
16201620

16211621
int accessPathLimit() { result = 5 }
16221622

1623+
/**
1624+
* Holds if accesspaths with `c` at their head always should be tracked at high
1625+
* precision. This disables adaptive accesspath precision for such accesspaths.
1626+
*/
1627+
predicate forceHighPrecision(Content c) { none() }
1628+
16231629
/** Holds if `n` should be hidden from path explanations. */
16241630
predicate nodeIsHidden(Node n) { none() }
16251631

0 commit comments

Comments
 (0)