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

Side by Side Diff: src/wasm/ast-decoder.h

Issue 2271803004: [wasm] Bound the allowed number of locals. (Closed)
Patch Set: Add a constant for the limit and test it. Created 4 years, 3 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/ast-decoder.cc » ('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 #ifndef V8_WASM_AST_DECODER_H_ 5 #ifndef V8_WASM_AST_DECODER_H_
6 #define V8_WASM_AST_DECODER_H_ 6 #define V8_WASM_AST_DECODER_H_
7 7
8 #include "src/signature.h" 8 #include "src/signature.h"
9 #include "src/wasm/decoder.h" 9 #include "src/wasm/decoder.h"
10 #include "src/wasm/wasm-opcodes.h" 10 #include "src/wasm/wasm-opcodes.h"
11 #include "src/wasm/wasm-result.h" 11 #include "src/wasm/wasm-result.h"
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace internal { 14 namespace internal {
15 15
16 class BitVector; // forward declaration 16 class BitVector; // forward declaration
17 17
18 namespace compiler { // external declarations from compiler. 18 namespace compiler { // external declarations from compiler.
19 class WasmGraphBuilder; 19 class WasmGraphBuilder;
20 } 20 }
21 21
22 namespace wasm { 22 namespace wasm {
23 23
24 const uint32_t kMaxNumWasmLocals = 8000000;
25
24 // Helpers for decoding different kinds of operands which follow bytecodes. 26 // Helpers for decoding different kinds of operands which follow bytecodes.
25 struct LocalIndexOperand { 27 struct LocalIndexOperand {
26 uint32_t index; 28 uint32_t index;
27 LocalType type; 29 LocalType type;
28 unsigned length; 30 unsigned length;
29 31
30 inline LocalIndexOperand(Decoder* decoder, const byte* pc) { 32 inline LocalIndexOperand(Decoder* decoder, const byte* pc) {
31 index = decoder->checked_read_u32v(pc, 1, &length, "local index"); 33 index = decoder->checked_read_u32v(pc, 1, &length, "local index");
32 type = kAstStmt; 34 type = kAstStmt;
33 } 35 }
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 } 332 }
331 333
332 bool has_next() { return pc_ < end_; } 334 bool has_next() { return pc_ < end_; }
333 }; 335 };
334 336
335 } // namespace wasm 337 } // namespace wasm
336 } // namespace internal 338 } // namespace internal
337 } // namespace v8 339 } // namespace v8
338 340
339 #endif // V8_WASM_AST_DECODER_H_ 341 #endif // V8_WASM_AST_DECODER_H_
OLDNEW
« no previous file with comments | « no previous file | src/wasm/ast-decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698