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

Unified Diff: runtime/vm/parser.cc

Issue 390003002: Fix crash bug with noSuchMethod invocation and argument count mismatch. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 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/regress_12561_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 38181)
+++ runtime/vm/parser.cc (working copy)
@@ -1377,9 +1377,20 @@
const String& func_name = String::ZoneHandle(I, func.name());
ArgumentListNode* arguments = BuildNoSuchMethodArguments(
token_pos, func_name, *func_args, NULL, false);
- const Function& no_such_method = Function::ZoneHandle(I,
- Resolver::ResolveDynamicAnyArgs(Class::Handle(
- I, func.Owner()), Symbols::NoSuchMethod()));
+ const intptr_t kNumArguments = 2; // Receiver, InvocationMirror.
+ ArgumentsDescriptor args_desc(
+ Array::Handle(I, ArgumentsDescriptor::New(kNumArguments)));
+ Function& no_such_method = Function::ZoneHandle(I,
+ Resolver::ResolveDynamicForReceiverClass(Class::Handle(I, func.Owner()),
+ Symbols::NoSuchMethod(),
+ args_desc));
+ if (no_such_method.IsNull()) {
+ // If noSuchMethod(i) is not found, call Object:noSuchMethod.
+ no_such_method ^= Resolver::ResolveDynamicForReceiverClass(
Ivan Posva 2014/07/14 10:03:19 Indentation.
Florian Schneider 2014/07/14 10:06:20 Done.
+ Class::Handle(I, I->object_store()->object_class()),
+ Symbols::NoSuchMethod(),
+ args_desc);
+ }
StaticCallNode* call =
new StaticCallNode(token_pos, no_such_method, arguments);
« no previous file with comments | « no previous file | tests/language/regress_12561_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698