| OLD | NEW |
| 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 "test/unittests/test-utils.h" | 5 #include "test/unittests/test-utils.h" |
| 6 | 6 |
| 7 #include "src/handles.h" | 7 #include "src/handles.h" |
| 8 #include "src/objects-inl.h" | 8 #include "src/objects-inl.h" |
| 9 #include "src/wasm/module-decoder.h" | 9 #include "src/wasm/module-decoder.h" |
| 10 #include "src/wasm/wasm-macro-gen.h" | 10 #include "src/wasm/wasm-macro-gen.h" |
| (...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 // signatures | 1197 // signatures |
| 1198 SIGNATURES_SECTION_VOID_VOID, | 1198 SIGNATURES_SECTION_VOID_VOID, |
| 1199 ONE_EMPTY_FUNCTION, | 1199 ONE_EMPTY_FUNCTION, |
| 1200 SECTION(Export, 1 + 6), | 1200 SECTION(Export, 1 + 6), |
| 1201 1, // exports | 1201 1, // exports |
| 1202 NO_NAME, // -- | 1202 NO_NAME, // -- |
| 1203 kExternalFunction, | 1203 kExternalFunction, |
| 1204 FUNC_INDEX(0), // -- | 1204 FUNC_INDEX(0), // -- |
| 1205 }; | 1205 }; |
| 1206 | 1206 |
| 1207 for (int length = 33; length < sizeof(data); length++) { | 1207 for (size_t length = 33; length < sizeof(data); length++) { |
| 1208 ModuleResult result = DecodeModule(data, data + length); | 1208 ModuleResult result = DecodeModule(data, data + length); |
| 1209 EXPECT_FALSE(result.ok()); | 1209 EXPECT_FALSE(result.ok()); |
| 1210 if (result.val) delete result.val; | 1210 if (result.val) delete result.val; |
| 1211 } | 1211 } |
| 1212 } | 1212 } |
| 1213 | 1213 |
| 1214 TEST_F(WasmModuleVerifyTest, FunctionSignatures_empty) { | 1214 TEST_F(WasmModuleVerifyTest, FunctionSignatures_empty) { |
| 1215 static const byte data[] = { | 1215 static const byte data[] = { |
| 1216 SECTION(Type, 1), 0, // -- | 1216 SECTION(Type, 1), 0, // -- |
| 1217 SECTION(Function, 1), 0 // -- | 1217 SECTION(Function, 1), 0 // -- |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1390 SECTION(Unknown, 4), 1, 'X', 17, 18, // -- | 1390 SECTION(Unknown, 4), 1, 'X', 17, 18, // -- |
| 1391 SECTION(Unknown, 9), 3, 'f', 'o', 'o', 5, 6, 7, 8, 9, // -- | 1391 SECTION(Unknown, 9), 3, 'f', 'o', 'o', 5, 6, 7, 8, 9, // -- |
| 1392 SECTION(Unknown, 8), 5, 'o', 't', 'h', 'e', 'r', 7, 8, // -- | 1392 SECTION(Unknown, 8), 5, 'o', 't', 'h', 'e', 'r', 7, 8, // -- |
| 1393 }; | 1393 }; |
| 1394 EXPECT_VERIFIES(data); | 1394 EXPECT_VERIFIES(data); |
| 1395 } | 1395 } |
| 1396 | 1396 |
| 1397 } // namespace wasm | 1397 } // namespace wasm |
| 1398 } // namespace internal | 1398 } // namespace internal |
| 1399 } // namespace v8 | 1399 } // namespace v8 |
| OLD | NEW |