@@ -202,6 +202,9 @@ predicate callMatchesSignature(Function func, Call call) {
202202 )
203203}
204204
205+ pragma [ nomagic]
206+ private File getFunctionFile ( Function f ) { result = f .getLocation ( ) .getFile ( ) }
207+
205208/** Gets a call which matches the signature of `base`, but not of overridden `sub`. */
206209Call getASignatureMismatchWitness ( Function base , Function sub ) {
207210 callViableForEitherOverride ( base , sub , result ) and
@@ -224,17 +227,17 @@ Call chooseASignatureMismatchWitnessInFile(Function base, Function sub, File fil
224227Call chooseASignatureMismatchWitness ( Function base , Function sub ) {
225228 exists ( getASignatureMismatchWitness ( base , sub ) ) and
226229 (
227- result = chooseASignatureMismatchWitnessInFile ( base , sub , base . getLocation ( ) . getFile ( ) )
230+ result = chooseASignatureMismatchWitnessInFile ( base , sub , getFunctionFile ( base ) )
228231 or
229232 not exists ( Call c |
230233 c = getASignatureMismatchWitness ( base , sub ) and
231234 c .getLocation ( ) .getFile ( ) = base .getLocation ( ) .getFile ( )
232235 ) and
233- result = chooseASignatureMismatchWitnessInFile ( base , sub , sub . getLocation ( ) . getFile ( ) )
236+ result = chooseASignatureMismatchWitnessInFile ( base , sub , getFunctionFile ( sub ) )
234237 or
235238 not exists ( Call c |
236239 c = getASignatureMismatchWitness ( base , sub ) and
237- c .getLocation ( ) .getFile ( ) = [ base , sub ] . getLocation ( ) . getFile ( )
240+ c .getLocation ( ) .getFile ( ) = getFunctionFile ( [ base , sub ] )
238241 ) and
239242 result =
240243 min ( Call c |
0 commit comments