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

Unified Diff: vm/code_generator.cc

Issue 8363034: Report NullPointerException when we try to construct a regular expression (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 9 years, 2 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 | « vm/ast.h ('k') | vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/code_generator.cc
===================================================================
--- vm/code_generator.cc (revision 858)
+++ vm/code_generator.cc (working copy)
@@ -608,7 +608,10 @@
return; // Return closure object.
}
}
- Exceptions::ThrowByType(Exceptions::kObjectNotClosure, invoke_arguments);
+ Exceptions::ThrowByType(
+ result.IsNull() ? Exceptions::kNullPointer :
+ Exceptions::kObjectNotClosure,
+ invoke_arguments);
}
@@ -732,6 +735,10 @@
ASSERT(arguments.Count() ==
kReportObjectNotClosureRuntimeEntry.argument_count());
const Instance& bad_closure = Instance::CheckedHandle(arguments.At(0));
+ if (bad_closure.IsNull()) {
+ GrowableArray<const Object*> args;
+ Exceptions::ThrowByType(Exceptions::kNullPointer, args);
+ }
// const Array& arguments = Array::CheckedHandle(arguments.At(1));
OS::PrintErr("object '%s' is not a closure\n", bad_closure.ToCString());
GrowableArray<const Object*> args;
« no previous file with comments | « vm/ast.h ('k') | vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698