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

Unified Diff: src/messages.cc

Issue 2196263002: CHECK invalid arguments to CallSite constructor (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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 | no next file » | 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 3fc73eb18dc33c790632812e7a963589275f6a53..f2dba702e7a2157a2091ee20e11cccaa8ed7f3e5 100644
--- a/src/messages.cc
+++ b/src/messages.cc
@@ -916,9 +916,10 @@ MaybeHandle<Object> CallSiteUtils::Construct(
}
if (is_wasm_object) {
- DCHECK(fun->IsSmi());
- DCHECK(wasm::GetNumberOfFunctions(JSObject::cast(*receiver)) >
- Smi::cast(*fun)->value());
+ // TODO(jgruber): Convert back to DCHECK once the callsite constructor is
+ // inaccessible from JS.
+ CHECK(fun->IsSmi() && (wasm::GetNumberOfFunctions(JSObject::cast(
+ *receiver)) > Smi::cast(*fun)->value()));
SET_CALLSITE_PROPERTY(obj, call_site_wasm_obj_symbol, receiver);
SET_CALLSITE_PROPERTY(obj, call_site_wasm_func_index_symbol, fun);
@@ -928,7 +929,10 @@ MaybeHandle<Object> CallSiteUtils::Construct(
SET_CALLSITE_PROPERTY(obj, call_site_function_symbol, fun);
}
- DCHECK(pos->IsSmi());
+ // TODO(jgruber): Convert back to DCHECK once the callsite constructor is
+ // inaccessible from JS.
+ CHECK(pos->IsSmi());
+
SET_CALLSITE_PROPERTY(obj, call_site_position_symbol, pos);
SET_CALLSITE_PROPERTY(
obj, call_site_strict_symbol,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698