Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 1684913002: Resolve correct noSuchMethod (fixes #25671, #25737). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address comment Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index 63bdb2473654b5a8bc1386ba554e5dff4186d9f8..8463f3fe258729c4698753554306daa9b08807a7 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -4442,8 +4442,23 @@ StaticCallInstr* EffectGraphVisitor::BuildStaticNoSuchMethodCall(
*method_arguments,
temp,
is_super_invocation);
- const Function& no_such_method_func = Function::ZoneHandle(Z,
- Resolver::ResolveDynamicAnyArgs(target_class, Symbols::NoSuchMethod()));
+ // Make sure we resolve to a compatible noSuchMethod, otherwise call
+ // noSuchMethod of class Object.
+ const int kNumArguments = 2;
+ ArgumentsDescriptor args_desc(
+ Array::ZoneHandle(Z, ArgumentsDescriptor::New(kNumArguments)));
+ Function& no_such_method_func = Function::ZoneHandle(Z,
+ Resolver::ResolveDynamicForReceiverClass(target_class,
+ Symbols::NoSuchMethod(),
+ args_desc));
+ if (no_such_method_func.IsNull()) {
+ const Class& object_class =
+ Class::ZoneHandle(Z, isolate()->object_store()->object_class());
+ no_such_method_func =
+ Resolver::ResolveDynamicForReceiverClass(object_class,
+ Symbols::NoSuchMethod(),
+ args_desc);
+ }
// We are guaranteed to find noSuchMethod of class Object.
ASSERT(!no_such_method_func.IsNull());
ZoneGrowableArray<PushArgumentInstr*>* push_arguments =
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698