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

Unified Diff: runtime/lib/mirrors.cc

Issue 29413003: Fix VM crash when ClosureMirror.findInContext operates on a fake function. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « no previous file | tests/lib/lib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors.cc
diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc
index dc6808b8b8974895958d52688cf6f22a8a88563c..9b7e9e6d593c31d3a5b02e8ba1036c685a7e5928 100644
--- a/runtime/lib/mirrors.cc
+++ b/runtime/lib/mirrors.cc
@@ -1450,6 +1450,12 @@ DEFINE_NATIVE_ENTRY(ClosureMirror_find_in_context, 2) {
GET_NON_NULL_NATIVE_ARGUMENT(Array, lookup_parts, arguments->NativeArgAt(1));
ASSERT(lookup_parts.Length() >= 1 && lookup_parts.Length() <= 3);
+ if (!closure.IsClosure()) {
+ const Array& result_tuple = Array::Handle(Array::New(2));
+ result_tuple.SetAt(0, Bool::False());
+ return result_tuple.raw();
+ }
+
Function& function = Function::Handle();
const bool callable = closure.IsCallable(&function, NULL);
ASSERT(callable);
« no previous file with comments | « no previous file | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698