[vm/aot] Do not devirtualize calls with mismatching number of type arguments

Fixes https://github.com/dart-lang/sdk/issues/38254

Change-Id: I9597b1aecc5b1040d4c7e18d6ea272ab74af7ddc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118463
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This commit is contained in:
Alexander Markov 2019-09-23 20:41:39 +00:00 committed by commit-bot@chromium.org
parent acac9ab11b
commit 9cc7ec8916

View file

@ -65,6 +65,11 @@ abstract class Devirtualization extends RecursiveVisitor<Null> {
}
}
if (arguments.types.isNotEmpty &&
arguments.types.length != func.typeParameters.length) {
return false;
}
return true;
}