File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed
ruby/ql/lib/codeql/ruby/typetracking Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ private module Cached {
41
41
exists ( TypeTrackerContentSet loadContents |
42
42
step = LoadStep ( pragma [ only_bind_into ] ( loadContents ) ) and
43
43
tt = MkTypeTracker ( hasCall , storeContents ) and
44
- storeContents . getAStoreContent ( ) = loadContents . getAReadContent ( ) and
44
+ compatibleContents ( storeContents , loadContents ) and
45
45
result = noContentTypeTracker ( hasCall )
46
46
)
47
47
or
@@ -76,7 +76,7 @@ private module Cached {
76
76
exists ( TypeTrackerContentSet storeContents |
77
77
step = StoreStep ( pragma [ only_bind_into ] ( storeContents ) ) and
78
78
tbt = MkTypeBackTracker ( hasReturn , loadContents ) and
79
- storeContents . getAStoreContent ( ) = loadContents . getAReadContent ( ) and
79
+ compatibleContents ( storeContents , loadContents ) and
80
80
result = noContentTypeBackTracker ( hasReturn )
81
81
)
82
82
or
Original file line number Diff line number Diff line change @@ -15,17 +15,18 @@ class Node = DataFlowPublic::Node;
15
15
16
16
class TypeTrackingNode = DataFlowPublic:: LocalSourceNode ;
17
17
18
- private newtype TOptionalTypeTrackerContent =
19
- MkAttribute ( string name ) { name = any ( Ast:: SetterMethodCall c ) .getTargetName ( ) } or
20
- MkContent ( DataFlowPublic:: Content content ) or
21
- MkNoContent ( )
22
-
23
- class TypeTrackerContent = DataFlowPublic:: Content ;
24
-
25
18
class TypeTrackerContentSet = DataFlowPublic:: ContentSet ;
26
19
27
20
class OptionalTypeTrackerContentSet = DataFlowPublic:: OptionalContentSet ;
28
21
22
+ /**
23
+ * Holds if a value stored with `storeContents` can be read back with `loadContents`.
24
+ */
25
+ pragma [ inline]
26
+ predicate compatibleContents ( TypeTrackerContentSet storeContents , TypeTrackerContentSet loadContents ) {
27
+ storeContents .getAStoreContent ( ) = loadContents .getAReadContent ( )
28
+ }
29
+
29
30
/** Gets the "no content set" value to use for a type tracker not inside any content. */
30
31
OptionalTypeTrackerContentSet noContentSet ( ) { result .isNoContentSet ( ) }
31
32
You can’t perform that action at this time.
0 commit comments