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

Side by Side Diff: runtime/vm/flow_graph_builder.cc

Issue 11273117: Fix issue 6403: do not crash if super indexed load does not exist (return 'no-such-method call' ins… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/language/super_operator_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/flow_graph_builder.h" 5 #include "vm/flow_graph_builder.h"
6 6
7 #include "vm/ast_printer.h" 7 #include "vm/ast_printer.h"
8 #include "vm/code_descriptors.h" 8 #include "vm/code_descriptors.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/flags.h" 10 #include "vm/flags.h"
(...skipping 2290 matching lines...) Expand 10 before | Expand all | Expand 10 after
2301 const String& index_operator_name = 2301 const String& index_operator_name =
2302 String::ZoneHandle(Symbols::IndexToken()); 2302 String::ZoneHandle(Symbols::IndexToken());
2303 super_function = &Function::ZoneHandle( 2303 super_function = &Function::ZoneHandle(
2304 Resolver::ResolveDynamicAnyArgs(node->super_class(), 2304 Resolver::ResolveDynamicAnyArgs(node->super_class(),
2305 index_operator_name)); 2305 index_operator_name));
2306 if (super_function->IsNull()) { 2306 if (super_function->IsNull()) {
2307 // Could not resolve super operator. Generate call noSuchMethod() of the 2307 // Could not resolve super operator. Generate call noSuchMethod() of the
2308 // super class instead. 2308 // super class instead.
2309 ArgumentListNode* arguments = new ArgumentListNode(node->token_pos()); 2309 ArgumentListNode* arguments = new ArgumentListNode(node->token_pos());
2310 arguments->Add(node->index_expr()); 2310 arguments->Add(node->index_expr());
2311 BuildStaticNoSuchMethodCall(node->super_class(), 2311 StaticCallInstr* call =
2312 node->array(), 2312 BuildStaticNoSuchMethodCall(node->super_class(),
2313 index_operator_name, 2313 node->array(),
2314 arguments); 2314 index_operator_name,
2315 arguments);
2316 ReturnDefinition(call);
2315 return; 2317 return;
2316 } 2318 }
2317 } 2319 }
2318 ZoneGrowableArray<PushArgumentInstr*>* arguments = 2320 ZoneGrowableArray<PushArgumentInstr*>* arguments =
2319 new ZoneGrowableArray<PushArgumentInstr*>(2); 2321 new ZoneGrowableArray<PushArgumentInstr*>(2);
2320 ValueGraphVisitor for_array(owner(), temp_index()); 2322 ValueGraphVisitor for_array(owner(), temp_index());
2321 node->array()->Visit(&for_array); 2323 node->array()->Visit(&for_array);
2322 Append(for_array); 2324 Append(for_array);
2323 arguments->Add(PushArgument(for_array.value())); 2325 arguments->Add(PushArgument(for_array.value()));
2324 2326
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
2846 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; 2848 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1;
2847 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 2849 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
2848 OS::SNPrint(chars, len, kFormat, function_name, reason); 2850 OS::SNPrint(chars, len, kFormat, function_name, reason);
2849 const Error& error = Error::Handle( 2851 const Error& error = Error::Handle(
2850 LanguageError::New(String::Handle(String::New(chars)))); 2852 LanguageError::New(String::Handle(String::New(chars))));
2851 Isolate::Current()->long_jump_base()->Jump(1, error); 2853 Isolate::Current()->long_jump_base()->Jump(1, error);
2852 } 2854 }
2853 2855
2854 2856
2855 } // namespace dart 2857 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/language/super_operator_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698