@@ -371,46 +371,49 @@ private string paramsString(InterpretedCallable c) {
371371 )
372372}
373373
374+ /** Gets the source/sink/summary/neutral base declaration corresponding to the supplied parameters. */
374375pragma [ nomagic]
375- private Element interpretElement0 (
376- string namespace , string type , boolean subtypes , string name , string signature
377- ) {
378- exists ( UnboundValueOrRefType t | elementSpec ( namespace , type , subtypes , name , signature , _, t ) |
379- exists ( Declaration m |
380- (
381- result = m
382- or
383- subtypes = true and result .( UnboundCallable ) .overridesOrImplementsUnbound ( m )
384- ) and
385- m .getDeclaringType ( ) = t and
386- hasName ( m , name )
387- |
388- signature = ""
389- or
390- paramsString ( m ) = signature
391- )
376+ Declaration interpretBaseDeclaration ( string namespace , string type , string name , string signature ) {
377+ exists ( UnboundValueOrRefType t | elementSpec ( namespace , type , _, name , signature , _, t ) |
378+ result =
379+ any ( Declaration d |
380+ d .getDeclaringType ( ) = t and
381+ hasName ( d , name ) and
382+ (
383+ signature = ""
384+ or
385+ paramsString ( d ) = signature
386+ )
387+ )
392388 or
393- (
394- result = t
395- or
396- subtypes = true and
397- result = t .getASubTypeUnbound + ( )
398- ) and
399389 result = t and
400390 name = "" and
401391 signature = ""
402392 )
403393}
404394
405395/** Gets the source/sink/summary/neutral element corresponding to the supplied parameters. */
396+ pragma [ nomagic]
406397Element interpretElement (
407398 string namespace , string type , boolean subtypes , string name , string signature , string ext
408399) {
409400 elementSpec ( namespace , type , subtypes , name , signature , ext ) and
410- exists ( Element e | e = interpretElement0 ( namespace , type , subtypes , name , signature ) |
411- ext = "" and result = e
401+ exists ( Declaration base , Declaration d |
402+ base = interpretBaseDeclaration ( namespace , type , name , signature ) and
403+ (
404+ d = base
405+ or
406+ subtypes = true and
407+ (
408+ d .( UnboundCallable ) .overridesOrImplementsUnbound ( base )
409+ or
410+ d = base .( UnboundValueOrRefType ) .getASubTypeUnbound + ( )
411+ )
412+ )
413+ |
414+ ext = "" and result = d
412415 or
413- ext = "Attribute" and result .( Attributable ) .getAnAttribute ( ) .getType ( ) = e
416+ ext = "Attribute" and result .( Attributable ) .getAnAttribute ( ) .getType ( ) = d
414417 )
415418}
416419
@@ -491,7 +494,7 @@ string parameterQualifiedTypeNamesToString(Callable c) {
491494 concat ( int i , string s | s = parameterQualifiedType ( c .getParameter ( i ) ) | s , "," order by i )
492495}
493496
494- private predicate partialModel (
497+ predicate partialModel (
495498 UnboundCallable c , string namespace , string type , string name , string parameters
496499) {
497500 QN:: hasQualifiedName ( c , namespace , type , name ) and
0 commit comments