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

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

Issue 2692563002: Merged: [wasm] Accept version 0x1 binaries. (Closed)
Patch Set: 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 if (magic_word != kWasmMagic) { 229 if (magic_word != kWasmMagic) {
230 error(pos, pos, 230 error(pos, pos,
231 "expected magic word %02x %02x %02x %02x, " 231 "expected magic word %02x %02x %02x %02x, "
232 "found %02x %02x %02x %02x", 232 "found %02x %02x %02x %02x",
233 BYTES(kWasmMagic), BYTES(magic_word)); 233 BYTES(kWasmMagic), BYTES(magic_word));
234 } 234 }
235 235
236 pos = pc_; 236 pos = pc_;
237 { 237 {
238 uint32_t magic_version = consume_u32("wasm version"); 238 uint32_t magic_version = consume_u32("wasm version");
239 if (magic_version != kWasmVersion) { 239 if (magic_version != kWasmVersion &&
240 magic_version != kWasmLegacyVersion) {
240 error(pos, pos, 241 error(pos, pos,
241 "expected version %02x %02x %02x %02x, " 242 "expected version %02x %02x %02x %02x, "
242 "found %02x %02x %02x %02x", 243 "found %02x %02x %02x %02x",
243 BYTES(kWasmVersion), BYTES(magic_version)); 244 BYTES(kWasmVersion), BYTES(magic_version));
244 } 245 }
245 } 246 }
246 247
247 WasmSectionIterator section_iter(*this); 248 WasmSectionIterator section_iter(*this);
248 249
249 // ===== Type section ==================================================== 250 // ===== Type section ====================================================
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 result.push_back({section_start, name_offset, name_length, payload_offset, 1293 result.push_back({section_start, name_offset, name_length, payload_offset,
1293 payload_length, section_length}); 1294 payload_length, section_length});
1294 } 1295 }
1295 1296
1296 return result; 1297 return result;
1297 } 1298 }
1298 1299
1299 } // namespace wasm 1300 } // namespace wasm
1300 } // namespace internal 1301 } // namespace internal
1301 } // namespace v8 1302 } // 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