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

Unified Diff: src/isolate.cc

Issue 1101253003: Version 4.3.61.14 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.3
Patch Set: Created 5 years, 8 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 | « include/v8-version.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index 1cc7ac736d2275a33dece53ef51bbb77bcbad795..e9713dbec0742e8a2c2953bb7d11f7418c1d8648 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -718,7 +718,9 @@ void Isolate::SetFailedAccessCheckCallback(
static inline AccessCheckInfo* GetAccessCheckInfo(Isolate* isolate,
Handle<JSObject> receiver) {
- JSFunction* constructor = JSFunction::cast(receiver->map()->GetConstructor());
+ Object* maybe_constructor = receiver->map()->GetConstructor();
+ if (!maybe_constructor->IsJSFunction()) return NULL;
+ JSFunction* constructor = JSFunction::cast(maybe_constructor);
if (!constructor->shared()->IsApiFunction()) return NULL;
Object* data_obj =
@@ -729,11 +731,16 @@ static inline AccessCheckInfo* GetAccessCheckInfo(Isolate* isolate,
}
+static void ThrowAccessCheckError(Isolate* isolate) {
+ Handle<String> message =
+ isolate->factory()->InternalizeUtf8String("no access");
+ isolate->ScheduleThrow(*isolate->factory()->NewTypeError(message));
+}
+
+
void Isolate::ReportFailedAccessCheck(Handle<JSObject> receiver) {
if (!thread_local_top()->failed_access_check_callback_) {
- Handle<String> message = factory()->InternalizeUtf8String("no access");
- ScheduleThrow(*factory()->NewTypeError(message));
- return;
+ return ThrowAccessCheckError(this);
}
DCHECK(receiver->IsAccessCheckNeeded());
@@ -744,7 +751,10 @@ void Isolate::ReportFailedAccessCheck(Handle<JSObject> receiver) {
Handle<Object> data;
{ DisallowHeapAllocation no_gc;
AccessCheckInfo* access_check_info = GetAccessCheckInfo(this, receiver);
- if (!access_check_info) return;
+ if (!access_check_info) {
+ AllowHeapAllocation doesnt_matter_anymore;
+ return ThrowAccessCheckError(this);
+ }
data = handle(access_check_info->data(), this);
}
« no previous file with comments | « include/v8-version.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698