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

Unified Diff: src/wasm/wasm-js.cc

Issue 2358923003: [wasm] Bound the table size by Smi::kMaxValue. (Closed)
Patch Set: Bound the table size by 2^26 Created 4 years, 3 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 | test/mjsunit/wasm/table.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-js.cc
diff --git a/src/wasm/wasm-js.cc b/src/wasm/wasm-js.cc
index 9494d4c0df72771481cfbaac12e5b170ca3b1ff1..0b6b25b127f1429be3b0f019cc5e90aa53d16250 100644
--- a/src/wasm/wasm-js.cc
+++ b/src/wasm/wasm-js.cc
@@ -365,11 +365,12 @@ void WebAssemblyTable(const v8::FunctionCallbackInfo<v8::Value>& args) {
return;
}
}
+ const int max_table_size = 1 << 26;
// The descriptor's 'initial'.
int initial;
if (!GetIntegerProperty(isolate, &thrower, context, descriptor,
v8_str(isolate, "initial"), &initial, 0,
- std::numeric_limits<int>::max())) {
+ max_table_size)) {
return;
}
// The descriptor's 'maximum'.
@@ -377,7 +378,7 @@ void WebAssemblyTable(const v8::FunctionCallbackInfo<v8::Value>& args) {
bool has_maximum = true;
if (!GetIntegerProperty(isolate, &thrower, context, descriptor,
v8_str(isolate, "maximum"), &maximum, initial,
- std::numeric_limits<int>::max())) {
+ max_table_size)) {
if (reinterpret_cast<i::Isolate*>(isolate)->has_pending_exception() ||
thrower.error()) {
return;
« no previous file with comments | « no previous file | test/mjsunit/wasm/table.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698