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

Unified Diff: src/messages.cc

Issue 2010493002: Check CallSite arguments more rigorously (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add regression test case Created 4 years, 7 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.h » ('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 2062917e457a08a1baac6d1ea648bb3fb90cbfad..7228ba215110a0fd87bcb817419f35dd2ef2334b 100644
--- a/src/messages.cc
+++ b/src/messages.cc
@@ -182,14 +182,9 @@ CallSite::CallSite(Isolate* isolate, Handle<JSObject> call_site_obj)
// invalid: neither javascript nor wasm
return;
}
- Handle<Object> maybe_wasm_obj = JSObject::GetDataProperty(
- call_site_obj, isolate->factory()->call_site_wasm_obj_symbol());
- if (!maybe_wasm_obj->IsJSObject()) {
- // invalid: neither javascript nor wasm
- return;
- }
// wasm
- wasm_obj_ = Handle<JSObject>::cast(maybe_wasm_obj);
+ wasm_obj_ = Handle<JSObject>::cast(JSObject::GetDataProperty(
+ call_site_obj, isolate->factory()->call_site_wasm_obj_symbol()));
wasm_func_index_ = Smi::cast(*maybe_wasm_func_index)->value();
DCHECK(static_cast<int>(wasm_func_index_) >= 0);
}
@@ -210,8 +205,8 @@ Handle<Object> CallSite::GetFileName() {
Handle<Object> CallSite::GetFunctionName() {
if (IsWasm()) {
- MaybeHandle<String> name = wasm::GetWasmFunctionName(
- Handle<JSObject>::cast(wasm_obj_), wasm_func_index_);
+ MaybeHandle<String> name =
+ wasm::GetWasmFunctionName(wasm_obj_, wasm_func_index_);
if (name.is_null()) return isolate_->factory()->null_value();
return name.ToHandleChecked();
}
« no previous file with comments | « src/messages.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698