Skip to content

Commit 7139a2a

Browse files
aamcommit-bot@chromium.org
authored andcommitted
[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 flutter/flutter#19696 Fixes #37348 Change-Id: If6c53dd322f9788df241baf7071b98906336d2e5 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108860 Commit-Queue: Alexander Aprelev <[email protected]> Reviewed-by: Ryan Macnak <[email protected]>
1 parent d1bd3a2 commit 7139a2a

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

runtime/vm/resolver.cc

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,17 @@ RawFunction* Resolver::ResolveDynamicAnyArgs(Zone* zone,
119119
if (FLAG_lazy_dispatchers) {
120120
if (is_getter && function.IsNull()) {
121121
function = cls.LookupDynamicFunction(demangled);
122-
if (!function.IsNull() && allow_add) {
123-
// We were looking for the getter but found a method with the same
124-
// name. Create a method extractor and return it.
125-
// The extractor does not exist yet, so using GetMethodExtractor is
126-
// not necessary here.
127-
function = function.CreateMethodExtractor(function_name);
128-
return function.raw();
122+
if (!function.IsNull()) {
123+
if (allow_add) {
124+
// We were looking for the getter but found a method with the same
125+
// name. Create a method extractor and return it.
126+
// The extractor does not exist yet, so using GetMethodExtractor is
127+
// not necessary here.
128+
function = function.CreateMethodExtractor(function_name);
129+
return function.raw();
130+
} else {
131+
return Function::null();
132+
}
129133
}
130134
}
131135
}

0 commit comments

Comments
 (0)