@@ -180,38 +180,42 @@ private module Cached {
180
180
181
181
cached
182
182
CfgScope getTarget ( CfgNodes:: ExprNodes:: CallCfgNode call ) {
183
- exists ( string method |
184
- exists ( Module tp |
185
- instanceMethodCall ( call , tp , method ) and
186
- result = lookupMethod ( tp , method ) and
187
- if result .( Method ) .isPrivate ( )
188
- then
189
- exists ( Self self |
190
- self = call .getReceiver ( ) .getExpr ( ) and
191
- pragma [ only_bind_out ] ( self .getEnclosingModule ( ) .getModule ( ) .getSuperClass * ( ) ) =
192
- pragma [ only_bind_out ] ( result .getEnclosingModule ( ) .getModule ( ) )
193
- ) and
194
- // For now, we restrict the scope of top-level declarations to their file.
195
- // This may remove some plausible targets, but also removes a lot of
196
- // implausible targets
197
- if result .getEnclosingModule ( ) instanceof Toplevel
198
- then result .getFile ( ) = call .getFile ( )
183
+ // Temporarily disable operation resolution (due to bad performance)
184
+ not call .getExpr ( ) instanceof Operation and
185
+ (
186
+ exists ( string method |
187
+ exists ( Module tp |
188
+ instanceMethodCall ( call , tp , method ) and
189
+ result = lookupMethod ( tp , method ) and
190
+ if result .( Method ) .isPrivate ( )
191
+ then
192
+ exists ( Self self |
193
+ self = call .getReceiver ( ) .getExpr ( ) and
194
+ pragma [ only_bind_out ] ( self .getEnclosingModule ( ) .getModule ( ) .getSuperClass * ( ) ) =
195
+ pragma [ only_bind_out ] ( result .getEnclosingModule ( ) .getModule ( ) )
196
+ ) and
197
+ // For now, we restrict the scope of top-level declarations to their file.
198
+ // This may remove some plausible targets, but also removes a lot of
199
+ // implausible targets
200
+ if result .getEnclosingModule ( ) instanceof Toplevel
201
+ then result .getFile ( ) = call .getFile ( )
202
+ else any ( )
199
203
else any ( )
200
- else any ( )
204
+ )
205
+ or
206
+ exists ( DataFlow:: LocalSourceNode sourceNode |
207
+ methodCall ( call , sourceNode , method ) and
208
+ sourceNode = trackSingletonMethod ( result , method )
209
+ )
201
210
)
202
211
or
203
- exists ( DataFlow :: LocalSourceNode sourceNode |
204
- methodCall ( call , sourceNode , method ) and
205
- sourceNode = trackSingletonMethod ( result , method )
212
+ exists ( Module superClass , string method |
213
+ superCall ( call , superClass , method ) and
214
+ result = lookupMethod ( superClass , method )
206
215
)
216
+ or
217
+ result = yieldCall ( call )
207
218
)
208
- or
209
- exists ( Module superClass , string method |
210
- superCall ( call , superClass , method ) and
211
- result = lookupMethod ( superClass , method )
212
- )
213
- or
214
- result = yieldCall ( call )
215
219
}
216
220
}
217
221
0 commit comments