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

Unified Diff: test/cctest/wasm/test-run-wasm-module.cc

Issue 2418483002: [wasm] test deserialization when header is invalid (Closed)
Patch Set: [wasm] test deserialization when header is invalid Created 4 years, 2 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: test/cctest/wasm/test-run-wasm-module.cc
diff --git a/test/cctest/wasm/test-run-wasm-module.cc b/test/cctest/wasm/test-run-wasm-module.cc
index 8a45955b8dafd9b5e4b500ce905f71ffe3396b27..104eed7684ce3263fbea216ac1adb13ed1c84784 100644
--- a/test/cctest/wasm/test-run-wasm-module.cc
+++ b/test/cctest/wasm/test-run-wasm-module.cc
@@ -227,10 +227,16 @@ TEST(Run_WasmModule_Serialization) {
create_params.array_buffer_allocator =
CcTest::InitIsolateOnce()->array_buffer_allocator();
- for (int i = 0; i < 2; ++i) {
+ for (int i = 0; i < 3; ++i) {
v8::Isolate* v8_isolate = v8::Isolate::New(create_params);
if (i == 1) {
- // Mess with the serialized data to force recompilation.
+ // Mess the header.
bradnelson 2016/10/12 19:10:25 Mess with?
Mircea Trofin 2016/10/12 20:32:06 Done.
+ DCHECK_NE(0, data.first.get()[0]);
+ const_cast<uint8_t*>(data.first.get())[0] = 0;
bradnelson 2016/10/12 19:10:25 Kinda bad. Maybe create an accessor that's a frien
Mircea Trofin 2016/10/12 20:32:06 Done.
+ }
+
+ if (i == 2) {
+ // Reset the compiled module data.
data.first.reset();
data.second = 0;
}
« 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