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

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

Issue 2052623003: [wasm] improve handling of malformed input (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 4 years, 5 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 | « test/unittests/wasm/leb-helper-unittest.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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 WASM_STORE_MEM(MachineType::Float32(), WASM_ZERO, WASM_GET_LOCAL(kSum)), 173 WASM_STORE_MEM(MachineType::Float32(), WASM_ZERO, WASM_GET_LOCAL(kSum)),
174 WASM_GET_LOCAL(kIter))}; 174 WASM_GET_LOCAL(kIter))};
175 175
176 BitVector* assigned = Analyze(code + 1, code + arraysize(code)); 176 BitVector* assigned = Analyze(code + 1, code + arraysize(code));
177 for (int j = 0; j < assigned->length(); j++) { 177 for (int j = 0; j < assigned->length(); j++) {
178 bool expected = j == kIter || j == kSum; 178 bool expected = j == kIter || j == kSum;
179 CHECK_EQ(expected, assigned->Contains(j)); 179 CHECK_EQ(expected, assigned->Contains(j));
180 } 180 }
181 } 181 }
182 182
183 TEST_F(WasmLoopAssignmentAnalyzerTest, Malformed) {
184 byte code[] = {kExprLoop, kExprF32Neg, kExprBrTable, 0x0e, 'h', 'e',
185 'l', 'l', 'o', ',', ' ', 'w',
186 'o', 'r', 'l', 'd', '!'};
187 BitVector* assigned = Analyze(code, code + arraysize(code));
188 CHECK_NULL(assigned);
189 }
190
183 } // namespace wasm 191 } // namespace wasm
184 } // namespace internal 192 } // namespace internal
185 } // namespace v8 193 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/wasm/leb-helper-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698