@@ -352,10 +352,7 @@ private module Cached {
352
352
TFieldContent ( string name ) {
353
353
name = any ( InstanceVariable v ) .getName ( )
354
354
or
355
- exists ( SetterMethodCall c , string methodName |
356
- methodName = c .getMethodName ( ) and
357
- name = "@" + methodName .prefix ( methodName .length ( ) - 1 )
358
- )
355
+ name = "@" + any ( SetterMethodCall c ) .getTargetName ( )
359
356
}
360
357
361
358
/**
@@ -835,14 +832,10 @@ predicate storeStep(Node node1, ContentSet c, Node node2) {
835
832
// Attribute assignment, `receiver.property = value`
836
833
node2 .( PostUpdateNode ) .getPreUpdateNode ( ) .asExpr ( ) =
837
834
any ( CfgNodes:: ExprNodes:: MethodCallCfgNode call |
838
- call .getExpr ( ) instanceof SetterMethodCall and
839
835
node1 .asExpr ( ) = call .getArgument ( 0 ) and
840
836
call .getNumberOfArguments ( ) = 1 and
841
- c .isSingleton ( any ( Content:: FieldContent ct , string methodName |
842
- methodName = call .getExpr ( ) .getMethodName ( ) and
843
- ct .getName ( ) = "@" + methodName .prefix ( methodName .length ( ) - 1 )
844
- |
845
- ct
837
+ c .isSingleton ( any ( Content:: FieldContent ct |
838
+ ct .getName ( ) = "@" + call .getExpr ( ) .( SetterMethodCall ) .getTargetName ( )
846
839
) )
847
840
) .getReceiver ( )
848
841
or
@@ -884,7 +877,7 @@ predicate readStep(Node node1, ContentSet c, Node node2) {
884
877
// Attribute read, `receiver.field`. Note that we do not check whether
885
878
// the `field` method is really an attribute reader. This is probably fine
886
879
// because the read step has only effect if there exists a matching store step
887
- // (instance variable assignmentor setter method call).
880
+ // (instance variable assignment or setter method call).
888
881
node2 .asExpr ( ) =
889
882
any ( CfgNodes:: ExprNodes:: MethodCallCfgNode call |
890
883
node1 .asExpr ( ) = call .getReceiver ( ) and
0 commit comments