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

Side by Side Diff: test/unittests/wasm/loop-assignment-analysis-unittest.cc

Issue 2290233008: [wasm] Validate the index of set local in AnalyzeLoopAssignment (Closed)
Patch Set: The loop analysis should not do a validation. 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 | « src/wasm/ast-decoder.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 "test/unittests/test-utils.h" 5 #include "test/unittests/test-utils.h"
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "test/cctest/wasm/test-signatures.h" 9 #include "test/cctest/wasm/test-signatures.h"
10 10
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 } 180 }
181 181
182 TEST_F(WasmLoopAssignmentAnalyzerTest, Malformed) { 182 TEST_F(WasmLoopAssignmentAnalyzerTest, Malformed) {
183 byte code[] = {kExprLoop, kExprF32Neg, kExprBrTable, 0x0e, 'h', 'e', 183 byte code[] = {kExprLoop, kExprF32Neg, kExprBrTable, 0x0e, 'h', 'e',
184 'l', 'l', 'o', ',', ' ', 'w', 184 'l', 'l', 'o', ',', ' ', 'w',
185 'o', 'r', 'l', 'd', '!'}; 185 'o', 'r', 'l', 'd', '!'};
186 BitVector* assigned = Analyze(code, code + arraysize(code)); 186 BitVector* assigned = Analyze(code, code + arraysize(code));
187 CHECK_NULL(assigned); 187 CHECK_NULL(assigned);
188 } 188 }
189 189
190 TEST_F(WasmLoopAssignmentAnalyzerTest, regress_642867) {
191 static const byte code[] = {
192 WASM_LOOP(WASM_ZERO, kExprSetLocal, 0xfa, 0xff, 0xff, 0xff,
193 0x0f)}; // local index LEB128 0xfffffffa
194 // Just make sure that the analysis does not crash.
195 Analyze(code, code + arraysize(code));
196 }
197
190 } // namespace wasm 198 } // namespace wasm
191 } // namespace internal 199 } // namespace internal
192 } // namespace v8 200 } // namespace v8
OLDNEW
« no previous file with comments | « src/wasm/ast-decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698