Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6eca4ba

Browse files
committed
get around identical files by adding the ref() call somewhere else
1 parent 4089788 commit 6eca4ba

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/** Step Summaries and Type Tracking */
22

33
private import TypeTrackerSpecific
4-
private import semmle.python.internal.CachedStages
54

65
/**
76
* A string that may appear as the name of a piece of content. This will usually include things like:
@@ -41,7 +40,6 @@ private module Cached {
4140
/** Gets the summary resulting from appending `step` to type-tracking summary `tt`. */
4241
cached
4342
TypeTracker append(TypeTracker tt, StepSummary step) {
44-
Stages::TypeTracking::ref() and
4543
exists(Boolean hasCall, OptionalContentName content | tt = MkTypeTracker(hasCall, content) |
4644
step = LevelStep() and result = tt
4745
or

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
private import python
66
private import semmle.python.dataflow.new.internal.DataFlowPublic as DataFlowPublic
77
private import semmle.python.dataflow.new.internal.DataFlowPrivate as DataFlowPrivate
8+
import semmle.python.internal.CachedStages
89

910
class Node = DataFlowPublic::Node;
1011

@@ -21,7 +22,10 @@ predicate levelStep(Node pred, Node succ) { none() }
2122
* Gets the name of a possible piece of content. For Python, this is currently only attribute names,
2223
* using the name of the attribute for the corresponding content.
2324
*/
24-
string getPossibleContentName() { result = any(DataFlowPublic::AttrRef a).getAttributeName() }
25+
string getPossibleContentName() {
26+
Stages::TypeTracking::ref() and // the TypeTracking::append() etc. predicates that we want to cache depend on this predicate, so we can place the `ref()` call here to get around identical files.
27+
result = any(DataFlowPublic::AttrRef a).getAttributeName()
28+
}
2529

2630
/**
2731
* Gets a callable for the call where `nodeFrom` is used as the `i`'th argument.

0 commit comments

Comments
 (0)