@@ -192,6 +192,9 @@ predicate callMatchesSignature(Function func, Call call) {
192192 )
193193}
194194
195+ pragma [ nomagic]
196+ private File getFunctionFile ( Function f ) { result = f .getLocation ( ) .getFile ( ) }
197+
195198/** Gets a call which matches the signature of `base`, but not of overridden `sub`. */
196199Call getASignatureMismatchWitness ( Function base , Function sub ) {
197200 callViableForEitherOverride ( base , sub , result ) and
@@ -214,17 +217,17 @@ Call chooseASignatureMismatchWitnessInFile(Function base, Function sub, File fil
214217Call chooseASignatureMismatchWitness ( Function base , Function sub ) {
215218 exists ( getASignatureMismatchWitness ( base , sub ) ) and
216219 (
217- result = chooseASignatureMismatchWitnessInFile ( base , sub , base . getLocation ( ) . getFile ( ) )
220+ result = chooseASignatureMismatchWitnessInFile ( base , sub , getFunctionFile ( base ) )
218221 or
219222 not exists ( Call c |
220223 c = getASignatureMismatchWitness ( base , sub ) and
221224 c .getLocation ( ) .getFile ( ) = base .getLocation ( ) .getFile ( )
222225 ) and
223- result = chooseASignatureMismatchWitnessInFile ( base , sub , sub . getLocation ( ) . getFile ( ) )
226+ result = chooseASignatureMismatchWitnessInFile ( base , sub , getFunctionFile ( sub ) )
224227 or
225228 not exists ( Call c |
226229 c = getASignatureMismatchWitness ( base , sub ) and
227- c .getLocation ( ) .getFile ( ) = [ base , sub ] . getLocation ( ) . getFile ( )
230+ c .getLocation ( ) .getFile ( ) = getFunctionFile ( [ base , sub ] )
228231 ) and
229232 result =
230233 min ( Call c |
0 commit comments