OLD | NEW |
---|---|
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 "src/value-serializer.h" | 5 #include "src/value-serializer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "include/v8.h" | 10 #include "include/v8.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
67 } | 67 } |
68 } | 68 } |
69 | 69 |
70 const Local<Context>& serialization_context() { | 70 const Local<Context>& serialization_context() { |
71 return serialization_context_; | 71 return serialization_context_; |
72 } | 72 } |
73 const Local<Context>& deserialization_context() { | 73 const Local<Context>& deserialization_context() { |
74 return deserialization_context_; | 74 return deserialization_context_; |
75 } | 75 } |
76 | 76 |
77 bool AllowInlineWasm() const { return allow_inline_wasm_; } | |
78 void SetAllowInlineWasm(bool value) { allow_inline_wasm_ = value; } | |
79 | |
77 // Overridden in more specific fixtures. | 80 // Overridden in more specific fixtures. |
78 virtual ValueSerializer::Delegate* GetSerializerDelegate() { return nullptr; } | 81 virtual ValueSerializer::Delegate* GetSerializerDelegate() { return nullptr; } |
79 virtual void BeforeEncode(ValueSerializer*) {} | 82 virtual void BeforeEncode(ValueSerializer*) {} |
80 virtual void AfterEncode() {} | 83 virtual void AfterEncode() {} |
81 virtual ValueDeserializer::Delegate* GetDeserializerDelegate() { | 84 virtual ValueDeserializer::Delegate* GetDeserializerDelegate() { |
82 return nullptr; | 85 return nullptr; |
83 } | 86 } |
84 virtual void BeforeDecode(ValueDeserializer*) {} | 87 virtual void BeforeDecode(ValueDeserializer*) {} |
85 | 88 |
86 template <typename InputFunctor, typename OutputFunctor> | 89 template <typename InputFunctor, typename OutputFunctor> |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
165 template <typename OutputFunctor> | 168 template <typename OutputFunctor> |
166 void DecodeTest(const std::vector<uint8_t>& data, | 169 void DecodeTest(const std::vector<uint8_t>& data, |
167 const OutputFunctor& output_functor) { | 170 const OutputFunctor& output_functor) { |
168 Local<Context> context = deserialization_context(); | 171 Local<Context> context = deserialization_context(); |
169 Context::Scope scope(context); | 172 Context::Scope scope(context); |
170 TryCatch try_catch(isolate()); | 173 TryCatch try_catch(isolate()); |
171 ValueDeserializer deserializer(isolate(), &data[0], | 174 ValueDeserializer deserializer(isolate(), &data[0], |
172 static_cast<int>(data.size()), | 175 static_cast<int>(data.size()), |
173 GetDeserializerDelegate()); | 176 GetDeserializerDelegate()); |
174 deserializer.SetSupportsLegacyWireFormat(true); | 177 deserializer.SetSupportsLegacyWireFormat(true); |
178 deserializer.SetAllowInlineWasm(AllowInlineWasm()); | |
175 BeforeDecode(&deserializer); | 179 BeforeDecode(&deserializer); |
176 ASSERT_TRUE(deserializer.ReadHeader(context).FromMaybe(false)); | 180 ASSERT_TRUE(deserializer.ReadHeader(context).FromMaybe(false)); |
177 Local<Value> result; | 181 Local<Value> result; |
178 ASSERT_TRUE(deserializer.ReadValue(context).ToLocal(&result)); | 182 ASSERT_TRUE(deserializer.ReadValue(context).ToLocal(&result)); |
179 ASSERT_FALSE(result.IsEmpty()); | 183 ASSERT_FALSE(result.IsEmpty()); |
180 ASSERT_FALSE(try_catch.HasCaught()); | 184 ASSERT_FALSE(try_catch.HasCaught()); |
181 ASSERT_TRUE( | 185 ASSERT_TRUE( |
182 context->Global() | 186 context->Global() |
183 ->CreateDataProperty(context, StringFromUtf8("result"), result) | 187 ->CreateDataProperty(context, StringFromUtf8("result"), result) |
184 .FromMaybe(false)); | 188 .FromMaybe(false)); |
185 output_functor(result); | 189 output_functor(result); |
186 ASSERT_FALSE(try_catch.HasCaught()); | 190 ASSERT_FALSE(try_catch.HasCaught()); |
187 } | 191 } |
188 | 192 |
189 template <typename OutputFunctor> | 193 template <typename OutputFunctor> |
190 void DecodeTestForVersion0(const std::vector<uint8_t>& data, | 194 void DecodeTestForVersion0(const std::vector<uint8_t>& data, |
191 const OutputFunctor& output_functor) { | 195 const OutputFunctor& output_functor) { |
192 Local<Context> context = deserialization_context(); | 196 Local<Context> context = deserialization_context(); |
193 Context::Scope scope(context); | 197 Context::Scope scope(context); |
194 TryCatch try_catch(isolate()); | 198 TryCatch try_catch(isolate()); |
195 ValueDeserializer deserializer(isolate(), &data[0], | 199 ValueDeserializer deserializer(isolate(), &data[0], |
196 static_cast<int>(data.size()), | 200 static_cast<int>(data.size()), |
197 GetDeserializerDelegate()); | 201 GetDeserializerDelegate()); |
198 deserializer.SetSupportsLegacyWireFormat(true); | 202 deserializer.SetSupportsLegacyWireFormat(true); |
203 deserializer.SetAllowInlineWasm(AllowInlineWasm()); | |
199 BeforeDecode(&deserializer); | 204 BeforeDecode(&deserializer); |
200 ASSERT_TRUE(deserializer.ReadHeader(context).FromMaybe(false)); | 205 ASSERT_TRUE(deserializer.ReadHeader(context).FromMaybe(false)); |
201 ASSERT_EQ(0u, deserializer.GetWireFormatVersion()); | 206 ASSERT_EQ(0u, deserializer.GetWireFormatVersion()); |
202 Local<Value> result; | 207 Local<Value> result; |
203 ASSERT_TRUE(deserializer.ReadValue(context).ToLocal(&result)); | 208 ASSERT_TRUE(deserializer.ReadValue(context).ToLocal(&result)); |
204 ASSERT_FALSE(result.IsEmpty()); | 209 ASSERT_FALSE(result.IsEmpty()); |
205 ASSERT_FALSE(try_catch.HasCaught()); | 210 ASSERT_FALSE(try_catch.HasCaught()); |
206 ASSERT_TRUE( | 211 ASSERT_TRUE( |
207 context->Global() | 212 context->Global() |
208 ->CreateDataProperty(context, StringFromUtf8("result"), result) | 213 ->CreateDataProperty(context, StringFromUtf8("result"), result) |
209 .FromMaybe(false)); | 214 .FromMaybe(false)); |
210 output_functor(result); | 215 output_functor(result); |
211 ASSERT_FALSE(try_catch.HasCaught()); | 216 ASSERT_FALSE(try_catch.HasCaught()); |
212 } | 217 } |
213 | 218 |
214 void InvalidDecodeTest(const std::vector<uint8_t>& data) { | 219 void InvalidDecodeTest(const std::vector<uint8_t>& data) { |
215 Local<Context> context = deserialization_context(); | 220 Local<Context> context = deserialization_context(); |
216 Context::Scope scope(context); | 221 Context::Scope scope(context); |
217 TryCatch try_catch(isolate()); | 222 TryCatch try_catch(isolate()); |
218 ValueDeserializer deserializer(isolate(), &data[0], | 223 ValueDeserializer deserializer(isolate(), &data[0], |
219 static_cast<int>(data.size()), | 224 static_cast<int>(data.size()), |
220 GetDeserializerDelegate()); | 225 GetDeserializerDelegate()); |
221 deserializer.SetSupportsLegacyWireFormat(true); | 226 deserializer.SetSupportsLegacyWireFormat(true); |
227 deserializer.SetAllowInlineWasm(AllowInlineWasm()); | |
222 BeforeDecode(&deserializer); | 228 BeforeDecode(&deserializer); |
223 Maybe<bool> header_result = deserializer.ReadHeader(context); | 229 Maybe<bool> header_result = deserializer.ReadHeader(context); |
224 if (header_result.IsNothing()) { | 230 if (header_result.IsNothing()) { |
225 EXPECT_TRUE(try_catch.HasCaught()); | 231 EXPECT_TRUE(try_catch.HasCaught()); |
226 return; | 232 return; |
227 } | 233 } |
228 ASSERT_TRUE(header_result.ToChecked()); | 234 ASSERT_TRUE(header_result.ToChecked()); |
229 ASSERT_TRUE(deserializer.ReadValue(context).IsEmpty()); | 235 ASSERT_TRUE(deserializer.ReadValue(context).IsEmpty()); |
230 EXPECT_TRUE(try_catch.HasCaught()); | 236 EXPECT_TRUE(try_catch.HasCaught()); |
231 } | 237 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
268 Local<ArrayBuffer> ab = | 274 Local<ArrayBuffer> ab = |
269 ArrayBuffer::New(isolate(), static_cast<void*>(data), sizeof(data)); | 275 ArrayBuffer::New(isolate(), static_cast<void*>(data), sizeof(data)); |
270 return Uint8Array::New(ab, 0, sizeof(data)); | 276 return Uint8Array::New(ab, 0, sizeof(data)); |
271 } | 277 } |
272 | 278 |
273 private: | 279 private: |
274 Local<Context> serialization_context_; | 280 Local<Context> serialization_context_; |
275 Local<Context> deserialization_context_; | 281 Local<Context> deserialization_context_; |
276 Local<FunctionTemplate> host_object_constructor_template_; | 282 Local<FunctionTemplate> host_object_constructor_template_; |
277 i::Isolate* isolate_; | 283 i::Isolate* isolate_; |
284 bool allow_inline_wasm_ = false; | |
278 | 285 |
279 DISALLOW_COPY_AND_ASSIGN(ValueSerializerTest); | 286 DISALLOW_COPY_AND_ASSIGN(ValueSerializerTest); |
280 }; | 287 }; |
281 | 288 |
282 TEST_F(ValueSerializerTest, DecodeInvalid) { | 289 TEST_F(ValueSerializerTest, DecodeInvalid) { |
283 // Version tag but no content. | 290 // Version tag but no content. |
284 InvalidDecodeTest({0xff}); | 291 InvalidDecodeTest({0xff}); |
285 // Version too large. | 292 // Version too large. |
286 InvalidDecodeTest({0xff, 0x7f, 0x5f}); | 293 InvalidDecodeTest({0xff, 0x7f, 0x5f}); |
287 // Nonsense tag. | 294 // Nonsense tag. |
(...skipping 2299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2587 EXPECT_TRUE( | 2594 EXPECT_TRUE( |
2588 EvaluateScriptForResultBool("result.a.toString() === '4,5,6'")); | 2595 EvaluateScriptForResultBool("result.a.toString() === '4,5,6'")); |
2589 EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b")); | 2596 EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b")); |
2590 }); | 2597 }); |
2591 } | 2598 } |
2592 | 2599 |
2593 // It's expected that WebAssembly has more exhaustive tests elsewhere; this | 2600 // It's expected that WebAssembly has more exhaustive tests elsewhere; this |
2594 // mostly checks that the logic to embed it in structured clone serialization | 2601 // mostly checks that the logic to embed it in structured clone serialization |
2595 // works correctly. | 2602 // works correctly. |
2596 | 2603 |
2604 // A simple module which exports an "increment" function. | |
2605 // Copied from test/mjsunit/wasm/incrementer.wasm. | |
2606 const unsigned char kIncrementerWasm[] = { | |
2607 0, 97, 115, 109, 1, 0, 0, 0, 1, 6, 1, 96, 1, 127, 1, 127, | |
2608 3, 2, 1, 0, 7, 13, 1, 9, 105, 110, 99, 114, 101, 109, 101, 110, | |
2609 116, 0, 0, 10, 9, 1, 7, 0, 32, 0, 65, 1, 106, 11, | |
2610 }; | |
2611 | |
2597 class ValueSerializerTestWithWasm : public ValueSerializerTest { | 2612 class ValueSerializerTestWithWasm : public ValueSerializerTest { |
2613 public: | |
2614 ValueSerializerTestWithWasm() : serialize_delegate_(&transfer_modules_) {} | |
2615 | |
2616 void Reset() { | |
2617 current_serializer_delegate_ = nullptr; | |
2618 transfer_modules_.clear(); | |
2619 SetAllowInlineWasm(false); | |
2620 } | |
2621 | |
2622 void EnableTransferSerialization() { | |
2623 current_serializer_delegate_ = &serialize_delegate_; | |
2624 } | |
2625 | |
2626 void BeforeDecode(ValueDeserializer* deserializer) override { | |
2627 for (uint32_t i = 0; i < static_cast<uint32_t>(transfer_modules_.size()); | |
2628 ++i) { | |
2629 deserializer->TransferWasmCompiledModule( | |
2630 i, WasmCompiledModule::FromTransferrableModule(isolate(), | |
2631 transfer_modules_[i]) | |
2632 .ToLocalChecked()); | |
2633 } | |
2634 } | |
2635 | |
2598 protected: | 2636 protected: |
2599 static void SetUpTestCase() { | 2637 static void SetUpTestCase() { |
2600 g_saved_flag = i::FLAG_expose_wasm; | 2638 g_saved_flag = i::FLAG_expose_wasm; |
2601 i::FLAG_expose_wasm = true; | 2639 i::FLAG_expose_wasm = true; |
2602 ValueSerializerTest::SetUpTestCase(); | 2640 ValueSerializerTest::SetUpTestCase(); |
2603 } | 2641 } |
2604 | 2642 |
2605 static void TearDownTestCase() { | 2643 static void TearDownTestCase() { |
2606 ValueSerializerTest::TearDownTestCase(); | 2644 ValueSerializerTest::TearDownTestCase(); |
2607 i::FLAG_expose_wasm = g_saved_flag; | 2645 i::FLAG_expose_wasm = g_saved_flag; |
2608 g_saved_flag = false; | 2646 g_saved_flag = false; |
2609 } | 2647 } |
2610 | 2648 |
2649 class SerializeToTransfer : public ValueSerializer::Delegate { | |
2650 public: | |
2651 SerializeToTransfer( | |
2652 std::vector<WasmCompiledModule::TransferrableModule>* modules) | |
2653 : modules_(modules) {} | |
2654 Maybe<uint32_t> GetWasmModuleTransferId( | |
2655 Isolate* isolate, Local<WasmCompiledModule> module) override { | |
2656 modules_->push_back(module->GetTransferrableModule()); | |
2657 return Just(static_cast<uint32_t>(modules_->size()) - 1); | |
2658 } | |
2659 | |
2660 void ThrowDataCloneError(Local<String> message) override {} | |
jbroman
2017/03/17 14:44:37
Are you expecting this to be unreached? (If so, NO
Mircea Trofin
2017/03/17 16:55:31
Done.
| |
2661 | |
2662 private: | |
2663 std::vector<WasmCompiledModule::TransferrableModule>* modules_; | |
2664 }; | |
2665 | |
2666 ValueSerializer::Delegate* GetSerializerDelegate() override { | |
2667 return current_serializer_delegate_; | |
2668 } | |
2669 | |
2670 Local<WasmCompiledModule> MakeWasm() { | |
2671 return WasmCompiledModule::DeserializeOrCompile( | |
2672 isolate(), {nullptr, 0}, | |
2673 {kIncrementerWasm, sizeof(kIncrementerWasm)}) | |
2674 .ToLocalChecked(); | |
2675 } | |
2676 | |
2677 void ExpectPass() { | |
2678 RoundTripTest( | |
2679 [this]() { return MakeWasm(); }, | |
2680 [this](Local<Value> value) { | |
2681 ASSERT_TRUE(value->IsWebAssemblyCompiledModule()); | |
2682 EXPECT_TRUE(EvaluateScriptForResultBool( | |
2683 "new WebAssembly.Instance(result).exports.increment(8) === 9")); | |
2684 }); | |
2685 } | |
2686 | |
2687 void ExpectFail() { | |
2688 EncodeTest( | |
2689 [this]() { return MakeWasm(); }, | |
2690 [this](const std::vector<uint8_t>& data) { InvalidDecodeTest(data); }); | |
2691 } | |
2692 | |
2693 Local<Value> GetComplexObjectWithDuplicate() { | |
2694 Local<Value> wasm_module = MakeWasm(); | |
2695 serialization_context() | |
2696 ->Global() | |
2697 ->CreateDataProperty(serialization_context(), | |
2698 StringFromUtf8("wasm_module"), wasm_module) | |
2699 .FromMaybe(false); | |
2700 Local<Script> script = | |
2701 Script::Compile( | |
2702 serialization_context(), | |
2703 StringFromUtf8("({mod1: wasm_module, num: 2, mod2: wasm_module})")) | |
2704 .ToLocalChecked(); | |
2705 return script->Run(serialization_context()).ToLocalChecked(); | |
2706 } | |
2707 | |
2708 void VerifyComplexObject(Local<Value> value) { | |
2709 ASSERT_TRUE(value->IsObject()); | |
2710 EXPECT_TRUE(EvaluateScriptForResultBool( | |
2711 "result.mod1 instanceof WebAssembly.Module")); | |
2712 EXPECT_TRUE(EvaluateScriptForResultBool( | |
2713 "result.mod2 instanceof WebAssembly.Module")); | |
2714 EXPECT_TRUE(EvaluateScriptForResultBool("result.num === 2")); | |
2715 } | |
2716 | |
2717 Local<Value> GetComplexObjectWithMany() { | |
2718 Local<Value> wasm_module1 = MakeWasm(); | |
2719 Local<Value> wasm_module2 = MakeWasm(); | |
2720 serialization_context() | |
2721 ->Global() | |
2722 ->CreateDataProperty(serialization_context(), | |
2723 StringFromUtf8("wasm_module1"), wasm_module1) | |
2724 .FromMaybe(false); | |
2725 serialization_context() | |
2726 ->Global() | |
2727 ->CreateDataProperty(serialization_context(), | |
2728 StringFromUtf8("wasm_module2"), wasm_module2) | |
2729 .FromMaybe(false); | |
2730 Local<Script> script = | |
2731 Script::Compile( | |
2732 serialization_context(), | |
2733 StringFromUtf8( | |
2734 "({mod1: wasm_module1, num: 2, mod2: wasm_module2})")) | |
2735 .ToLocalChecked(); | |
2736 return script->Run(serialization_context()).ToLocalChecked(); | |
2737 } | |
2738 | |
2611 private: | 2739 private: |
2612 static bool g_saved_flag; | 2740 static bool g_saved_flag; |
2741 std::vector<WasmCompiledModule::TransferrableModule> transfer_modules_; | |
2742 SerializeToTransfer serialize_delegate_; | |
2743 ValueSerializer::Delegate* current_serializer_delegate_ = nullptr; | |
2613 }; | 2744 }; |
2614 | 2745 |
2615 bool ValueSerializerTestWithWasm::g_saved_flag = false; | 2746 bool ValueSerializerTestWithWasm::g_saved_flag = false; |
2616 | 2747 |
2617 // A simple module which exports an "increment" function. | 2748 // We only want to allow deserialization through |
2618 // Copied from test/mjsunit/wasm/incrementer.wasm. | 2749 // transferred modules - which requres both serializer |
2619 const unsigned char kIncrementerWasm[] = { | 2750 // and deserializer to understand that - or through |
2620 0, 97, 115, 109, 1, 0, 0, 0, 1, 6, 1, 96, 1, 127, 1, 127, | 2751 // explicitly allowing inlined data, which requires |
2621 3, 2, 1, 0, 7, 13, 1, 9, 105, 110, 99, 114, 101, 109, 101, 110, | 2752 // deserializer opt-in (we default the serializer to |
2622 116, 0, 0, 10, 9, 1, 7, 0, 32, 0, 65, 1, 106, 11, | 2753 // inlined data because we don't trust that data on the |
2623 }; | 2754 // receiving end anyway). |
2624 | 2755 |
2625 TEST_F(ValueSerializerTestWithWasm, RoundTripWasmModule) { | 2756 TEST_F(ValueSerializerTestWithWasm, RoundtripWasmTransfer) { |
2757 EnableTransferSerialization(); | |
2758 ExpectPass(); | |
2759 } | |
2760 | |
2761 TEST_F(ValueSerializerTestWithWasm, RountripWasmInline) { | |
2762 SetAllowInlineWasm(true); | |
2763 ExpectPass(); | |
2764 } | |
2765 | |
2766 TEST_F(ValueSerializerTestWithWasm, CannotDeserializeWasmInlineData) { | |
2767 ExpectFail(); | |
2768 } | |
2769 | |
2770 TEST_F(ValueSerializerTestWithWasm, CannotTransferWasmWhenExpectingInline) { | |
2771 EnableTransferSerialization(); | |
2772 SetAllowInlineWasm(true); | |
2773 ExpectFail(); | |
2774 } | |
2775 | |
2776 TEST_F(ValueSerializerTestWithWasm, ComplexObjectDuplicateTransfer) { | |
2777 EnableTransferSerialization(); | |
2626 RoundTripTest( | 2778 RoundTripTest( |
2627 [this]() { | 2779 [this]() { return GetComplexObjectWithDuplicate(); }, |
2628 return WasmCompiledModule::DeserializeOrCompile( | |
2629 isolate(), {nullptr, 0}, | |
2630 {kIncrementerWasm, sizeof(kIncrementerWasm)}) | |
2631 .ToLocalChecked(); | |
2632 }, | |
2633 [this](Local<Value> value) { | 2780 [this](Local<Value> value) { |
2634 ASSERT_TRUE(value->IsWebAssemblyCompiledModule()); | 2781 VerifyComplexObject(value); |
2635 EXPECT_TRUE(EvaluateScriptForResultBool( | 2782 EXPECT_TRUE(EvaluateScriptForResultBool("result.mod1 === result.mod2")); |
2636 "new WebAssembly.Instance(result).exports.increment(8) === 9")); | |
2637 }); | 2783 }); |
2638 } | 2784 } |
2639 | 2785 |
2786 TEST_F(ValueSerializerTestWithWasm, ComplexObjectDuplicateInline) { | |
2787 SetAllowInlineWasm(true); | |
2788 RoundTripTest( | |
2789 [this]() { return GetComplexObjectWithDuplicate(); }, | |
2790 [this](Local<Value> value) { | |
2791 VerifyComplexObject(value); | |
2792 EXPECT_TRUE(EvaluateScriptForResultBool("result.mod1 === result.mod2")); | |
2793 }); | |
2794 } | |
2795 | |
2796 TEST_F(ValueSerializerTestWithWasm, ComplexObjectWithManyTransfer) { | |
2797 EnableTransferSerialization(); | |
2798 RoundTripTest( | |
2799 [this]() { return GetComplexObjectWithMany(); }, | |
2800 [this](Local<Value> value) { | |
2801 VerifyComplexObject(value); | |
2802 EXPECT_TRUE(EvaluateScriptForResultBool("result.mod1 != result.mod2")); | |
2803 }); | |
2804 } | |
2805 | |
2806 TEST_F(ValueSerializerTestWithWasm, ComplexObjectWithManyInline) { | |
2807 SetAllowInlineWasm(true); | |
2808 RoundTripTest( | |
2809 [this]() { return GetComplexObjectWithMany(); }, | |
2810 [this](Local<Value> value) { | |
2811 VerifyComplexObject(value); | |
2812 EXPECT_TRUE(EvaluateScriptForResultBool("result.mod1 != result.mod2")); | |
2813 }); | |
2814 } | |
2815 | |
2640 // As produced around Chrome 56. | 2816 // As produced around Chrome 56. |
2641 const unsigned char kSerializedIncrementerWasm[] = { | 2817 const unsigned char kSerializedIncrementerWasm[] = { |
2642 0xff, 0x09, 0x3f, 0x00, 0x57, 0x79, 0x2d, 0x00, 0x61, 0x73, 0x6d, 0x0d, | 2818 0xff, 0x09, 0x3f, 0x00, 0x57, 0x79, 0x2d, 0x00, 0x61, 0x73, 0x6d, 0x0d, |
2643 0x00, 0x00, 0x00, 0x01, 0x06, 0x01, 0x60, 0x01, 0x7f, 0x01, 0x7f, 0x03, | 2819 0x00, 0x00, 0x00, 0x01, 0x06, 0x01, 0x60, 0x01, 0x7f, 0x01, 0x7f, 0x03, |
2644 0x02, 0x01, 0x00, 0x07, 0x0d, 0x01, 0x09, 0x69, 0x6e, 0x63, 0x72, 0x65, | 2820 0x02, 0x01, 0x00, 0x07, 0x0d, 0x01, 0x09, 0x69, 0x6e, 0x63, 0x72, 0x65, |
2645 0x6d, 0x65, 0x6e, 0x74, 0x00, 0x00, 0x0a, 0x08, 0x01, 0x06, 0x00, 0x20, | 2821 0x6d, 0x65, 0x6e, 0x74, 0x00, 0x00, 0x0a, 0x08, 0x01, 0x06, 0x00, 0x20, |
2646 0x00, 0x41, 0x01, 0x6a, 0xf8, 0x04, 0xa1, 0x06, 0xde, 0xc0, 0xc6, 0x44, | 2822 0x00, 0x41, 0x01, 0x6a, 0xf8, 0x04, 0xa1, 0x06, 0xde, 0xc0, 0xc6, 0x44, |
2647 0x3c, 0x29, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x02, 0x00, 0x00, 0x81, 0x4e, | 2823 0x3c, 0x29, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x02, 0x00, 0x00, 0x81, 0x4e, |
2648 0xce, 0x7c, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x30, 0x02, | 2824 0xce, 0x7c, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x30, 0x02, |
2649 0x00, 0x00, 0xb0, 0x25, 0x30, 0xe3, 0xf2, 0xdb, 0x2e, 0x48, 0x00, 0x00, | 2825 0x00, 0x00, 0xb0, 0x25, 0x30, 0xe3, 0xf2, 0xdb, 0x2e, 0x48, 0x00, 0x00, |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2744 InvalidDecodeTest(raw); | 2920 InvalidDecodeTest(raw); |
2745 } | 2921 } |
2746 | 2922 |
2747 TEST_F(ValueSerializerTestWithWasm, DecodeWasmModuleWithInvalidDataLength) { | 2923 TEST_F(ValueSerializerTestWithWasm, DecodeWasmModuleWithInvalidDataLength) { |
2748 InvalidDecodeTest({0xff, 0x09, 0x3f, 0x00, 0x57, 0x79, 0x7f, 0x00}); | 2924 InvalidDecodeTest({0xff, 0x09, 0x3f, 0x00, 0x57, 0x79, 0x7f, 0x00}); |
2749 InvalidDecodeTest({0xff, 0x09, 0x3f, 0x00, 0x57, 0x79, 0x00, 0x7f}); | 2925 InvalidDecodeTest({0xff, 0x09, 0x3f, 0x00, 0x57, 0x79, 0x00, 0x7f}); |
2750 } | 2926 } |
2751 | 2927 |
2752 } // namespace | 2928 } // namespace |
2753 } // namespace v8 | 2929 } // namespace v8 |
OLD | NEW |