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

Unified Diff: src/messages.cc

Issue 1404613002: Check for validity when accessing call site objects in runtime. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | « src/messages.h ('k') | src/runtime/runtime-internal.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/messages.cc
diff --git a/src/messages.cc b/src/messages.cc
index 640c2dff4e891266ce2fab0c206173dc1f7067c5..fb7a0ddb1b288059c78d07a9f2084ed6b4524e2c 100644
--- a/src/messages.cc
+++ b/src/messages.cc
@@ -144,10 +144,13 @@ base::SmartArrayPointer<char> MessageHandler::GetLocalizedMessage(
CallSite::CallSite(Isolate* isolate, Handle<JSObject> call_site_obj)
: isolate_(isolate) {
+ Handle<Object> maybe_function = JSObject::GetDataProperty(
+ call_site_obj, isolate->factory()->call_site_function_symbol());
+ if (!maybe_function->IsJSFunction()) return;
+
+ fun_ = Handle<JSFunction>::cast(maybe_function);
receiver_ = JSObject::GetDataProperty(
call_site_obj, isolate->factory()->call_site_receiver_symbol());
- fun_ = Handle<JSFunction>::cast(JSObject::GetDataProperty(
- call_site_obj, isolate->factory()->call_site_function_symbol()));
pos_ = Handle<Smi>::cast(JSObject::GetDataProperty(
call_site_obj,
isolate->factory()->call_site_position_symbol()))
« no previous file with comments | « src/messages.h ('k') | src/runtime/runtime-internal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698