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

Unified Diff: test/mjsunit/wasm/grow-memory.js

Issue 2288773002: [wasm] Check the input of grow-memory before calling the runtime. (Closed)
Patch Set: 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/compiler/wasm-compiler.cc ('K') | « src/compiler/wasm-compiler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/grow-memory.js
diff --git a/test/mjsunit/wasm/grow-memory.js b/test/mjsunit/wasm/grow-memory.js
index 27aca22d1a68060dc3ea95371046cbe5be9cbf4f..dd0bdc31a55cc7d097b38876fcf8706dd76dc729 100644
--- a/test/mjsunit/wasm/grow-memory.js
+++ b/test/mjsunit/wasm/grow-memory.js
@@ -117,3 +117,12 @@ function testGrowMemoryTrapMaxPages() {
}
testGrowMemoryTrapMaxPages();
+
+(function testGrowMemoryTrapsWithNonSmiInput() {
+ var builder = genGrowMemoryBuilder();
+ var module = builder.instantiate();
+ function growMem(pages) { return module.exports.grow_memory(pages); }
+ // The parameter of grow_memory is unsigned. Therefore -1 stands for
+ // UINT32_MIN, which cannot be represented as SMI.
+ assertEquals(-1, growMem(-1));
+})();
gdeepti 2016/08/30 02:19:56 Nit: Test not consistent with the format of other
ahaas 2016/08/30 06:49:53 You are right, it should be consistent. Done.
« src/compiler/wasm-compiler.cc ('K') | « src/compiler/wasm-compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698