Index: runtime/vm/dart_entry.cc |
diff --git a/runtime/vm/dart_entry.cc b/runtime/vm/dart_entry.cc |
index fd91fb0b017106352f93bfeae2ebfe54131cb076..e517fa269927a8201fbb9a8e0725a22cbb14111a 100644 |
--- a/runtime/vm/dart_entry.cc |
+++ b/runtime/vm/dart_entry.cc |
@@ -213,7 +213,9 @@ RawObject* DartEntry::InvokeNoSuchMethod(const Instance& receiver, |
const String& target_name, |
const Array& arguments, |
const Array& arguments_descriptor) { |
- ASSERT(receiver.raw() == arguments.At(0)); |
+ const ArgumentsDescriptor args_desc(arguments_descriptor); |
+ const intptr_t receiver_index = args_desc.TypeArgsLen() == 0 ? 0 : 1; |
+ ASSERT(receiver.raw() == arguments.At(receiver_index)); |
// Allocate an Invocation object. |
const Library& core_lib = Library::Handle(Library::CoreLibrary()); |
@@ -241,10 +243,10 @@ RawObject* DartEntry::InvokeNoSuchMethod(const Instance& receiver, |
// Now use the invocation mirror object and invoke NoSuchMethod. |
const int kTypeArgsLen = 0; |
const int kNumArguments = 2; |
- ArgumentsDescriptor args_desc( |
+ ArgumentsDescriptor nsm_args_desc( |
Array::Handle(ArgumentsDescriptor::New(kTypeArgsLen, kNumArguments))); |
- Function& function = Function::Handle( |
- Resolver::ResolveDynamic(receiver, Symbols::NoSuchMethod(), args_desc)); |
+ Function& function = Function::Handle(Resolver::ResolveDynamic( |
+ receiver, Symbols::NoSuchMethod(), nsm_args_desc)); |
if (function.IsNull()) { |
ASSERT(!FLAG_lazy_dispatchers); |
// If noSuchMethod(invocation) is not found, call Object::noSuchMethod. |
@@ -252,7 +254,7 @@ RawObject* DartEntry::InvokeNoSuchMethod(const Instance& receiver, |
function ^= Resolver::ResolveDynamicForReceiverClass( |
Class::Handle(thread->zone(), |
thread->isolate()->object_store()->object_class()), |
- Symbols::NoSuchMethod(), args_desc); |
+ Symbols::NoSuchMethod(), nsm_args_desc); |
} |
ASSERT(!function.IsNull()); |
const Array& args = Array::Handle(Array::New(kNumArguments)); |