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

Side by Side Diff: src/wasm/module-decoder.cc

Issue 2681993003: [wasm] Accept version 0x1 binaries. (Closed)
Patch Set: Add new expected outputs for inspector tests. Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/wasm/wasm-module.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/wasm/module-decoder.h" 5 #include "src/wasm/module-decoder.h"
6 6
7 #include "src/base/functional.h" 7 #include "src/base/functional.h"
8 #include "src/base/platform/platform.h" 8 #include "src/base/platform/platform.h"
9 #include "src/flags.h" 9 #include "src/flags.h"
10 #include "src/macro-assembler.h" 10 #include "src/macro-assembler.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 if (magic_word != kWasmMagic) { 231 if (magic_word != kWasmMagic) {
232 error(pos, pos, 232 error(pos, pos,
233 "expected magic word %02x %02x %02x %02x, " 233 "expected magic word %02x %02x %02x %02x, "
234 "found %02x %02x %02x %02x", 234 "found %02x %02x %02x %02x",
235 BYTES(kWasmMagic), BYTES(magic_word)); 235 BYTES(kWasmMagic), BYTES(magic_word));
236 } 236 }
237 237
238 pos = pc_; 238 pos = pc_;
239 { 239 {
240 uint32_t magic_version = consume_u32("wasm version"); 240 uint32_t magic_version = consume_u32("wasm version");
241 if (magic_version != kWasmVersion) { 241 if (magic_version != kWasmVersion &&
242 magic_version != kWasmLegacyVersion) {
242 error(pos, pos, 243 error(pos, pos,
243 "expected version %02x %02x %02x %02x, " 244 "expected version %02x %02x %02x %02x, "
244 "found %02x %02x %02x %02x", 245 "found %02x %02x %02x %02x",
245 BYTES(kWasmVersion), BYTES(magic_version)); 246 BYTES(kWasmVersion), BYTES(magic_version));
246 } 247 }
247 } 248 }
248 249
249 WasmSectionIterator section_iter(*this); 250 WasmSectionIterator section_iter(*this);
250 251
251 // ===== Type section ==================================================== 252 // ===== Type section ====================================================
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after
1296 result.push_back({section_start, name_offset, name_length, payload_offset, 1297 result.push_back({section_start, name_offset, name_length, payload_offset,
1297 payload_length, section_length}); 1298 payload_length, section_length});
1298 } 1299 }
1299 1300
1300 return result; 1301 return result;
1301 } 1302 }
1302 1303
1303 } // namespace wasm 1304 } // namespace wasm
1304 } // namespace internal 1305 } // namespace internal
1305 } // namespace v8 1306 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/wasm/wasm-module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698