@@ -16,7 +16,7 @@ class Node = DataFlowPublic::Node;
16
16
class TypeTrackingNode = DataFlowPublic:: LocalSourceNode ;
17
17
18
18
private newtype TOptionalTypeTrackerContent =
19
- MkAttribute ( string name ) { name = getSetterCallAttributeName ( _ ) } or
19
+ MkAttribute ( string name ) { name = any ( Ast :: SetterMethodCall c ) . getTargetName ( ) } or
20
20
MkContent ( DataFlowPublic:: Content content ) or
21
21
MkNoContent ( )
22
22
@@ -196,27 +196,14 @@ predicate basicStoreStep(Node nodeFrom, Node nodeTo, TypeTrackerContent content)
196
196
predicate postUpdateStoreStep ( Node nodeFrom , Node nodeTo , TypeTrackerContent content ) {
197
197
// TODO: support SetterMethodCall inside TuplePattern
198
198
exists ( ExprNodes:: MethodCallCfgNode call |
199
- content = MkAttribute ( getSetterCallAttributeName ( call .getExpr ( ) ) ) and
199
+ content = MkAttribute ( call .getExpr ( ) . ( Ast :: SetterMethodCall ) . getTargetName ( ) ) and
200
200
nodeTo .( DataFlowPublic:: PostUpdateNode ) .getPreUpdateNode ( ) .asExpr ( ) = call .getReceiver ( ) and
201
201
call .getExpr ( ) instanceof Ast:: SetterMethodCall and
202
202
call .getArgument ( call .getNumberOfArguments ( ) - 1 ) =
203
203
nodeFrom .( DataFlowPublic:: ExprNode ) .getExprNode ( )
204
204
)
205
205
}
206
206
207
- /**
208
- * Returns the name of the attribute being set by the setter method call, i.e.
209
- * the name of the setter method without the trailing `=`. In the following
210
- * example, the result is `"bar"`.
211
- *
212
- * ```rb
213
- * foo.bar = 1
214
- * ```
215
- */
216
- private string getSetterCallAttributeName ( Ast:: SetterMethodCall call ) {
217
- result = call .getTargetName ( )
218
- }
219
-
220
207
/**
221
208
* Holds if `nodeTo` is the result of accessing the `content` content of `nodeFrom`.
222
209
*/
0 commit comments