[vm] Fix function resolution so that it stops when it finds target even if it can't add method extractor.

The fact that function resolution returned a target led to incorrect range merging for polymorphic instance call sites.

Fixes https://github.com/flutter/flutter/issues/19696
Fixes https://github.com/dart-lang/sdk/issues/37348

Change-Id: If6c53dd322f9788df241baf7071b98906336d2e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108860
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Alexander Aprelev 2019-07-11 18:45:38 +00:00 committed by commit-bot@chromium.org
parent d1bd3a2f43
commit 7139a2ab3a

View file

@ -119,13 +119,17 @@ RawFunction* Resolver::ResolveDynamicAnyArgs(Zone* zone,
if (FLAG_lazy_dispatchers) {
if (is_getter && function.IsNull()) {
function = cls.LookupDynamicFunction(demangled);
if (!function.IsNull() && allow_add) {
// We were looking for the getter but found a method with the same
// name. Create a method extractor and return it.
// The extractor does not exist yet, so using GetMethodExtractor is
// not necessary here.
function = function.CreateMethodExtractor(function_name);
return function.raw();
if (!function.IsNull()) {
if (allow_add) {
// We were looking for the getter but found a method with the same
// name. Create a method extractor and return it.
// The extractor does not exist yet, so using GetMethodExtractor is
// not necessary here.
function = function.CreateMethodExtractor(function_name);
return function.raw();
} else {
return Function::null();
}
}
}
}