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

Unified Diff: test/unittests/wasm/ast-decoder-unittest.cc

Issue 2271803004: [wasm] Bound the allowed number of locals. (Closed)
Patch Set: Set the limit of local decls to 8000000 Created 4 years, 4 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
« src/wasm/ast-decoder.cc ('K') | « src/wasm/ast-decoder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/wasm/ast-decoder-unittest.cc
diff --git a/test/unittests/wasm/ast-decoder-unittest.cc b/test/unittests/wasm/ast-decoder-unittest.cc
index 7311f063a0ad8984ab47808cd8120ecb8dd8decb..83e78107832647e10942ccc15e0f5854bd6999c7 100644
--- a/test/unittests/wasm/ast-decoder-unittest.cc
+++ b/test/unittests/wasm/ast-decoder-unittest.cc
@@ -238,6 +238,11 @@ TEST_F(AstDecoderTest, GetLocal0_local) {
EXPECT_VERIFIES(sigs.i_v(), kCodeGetLocal0);
}
+TEST_F(AstDecoderTest, TooManyLocals) {
+ AddLocals(kAstI32, 4034986500);
+ EXPECT_FAILURE(sigs.i_v(), kCodeGetLocal0);
+}
+
TEST_F(AstDecoderTest, GetLocal0_param_n) {
FunctionSig* array[] = {sigs.i_i(), sigs.i_ii(), sigs.i_iii()};
« src/wasm/ast-decoder.cc ('K') | « src/wasm/ast-decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698