diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ddacccead..df3bc78e0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,12 +11,13 @@ tag versions. The Bond compiler (`gbc`) and different versioning scheme, following the Haskell community's [package versioning policy](https://wiki.haskell.org/Package_versioning_policy). -## Unreleased ## +## 11.0.1: 2024-06-26 ## -* IDL core version: TBD -* C++ version: TBD (major bump needed) -* C# NuGet version: TBD (major bump needed) -* `gbc` & compiler library: TBD (major bump needed) +* IDL core version: 3.0 +* C++ version: 11.0.1 +* C# NuGet version: 11.0.1 +* Java version: 11.0.1 +* `gbc` & compiler library: 0.13.0.0 ### `gbc` and Bond compiler library ### * **Breaking change**: Codegen for Bond-over-gRPC has been removed: the @@ -34,9 +35,22 @@ different versioning scheme, following the Haskell community's See [issue \#1131, Bond-over-gRPC will be deprecated February 2022](https://github.com/microsoft/bond/issues/1131), for the full announcement. +* By default, deserialization will no longer process very deeply nested + structures. Instead, an `bond::CoreException` will be thrown in order to + protect against stack overflows. The depth limit may be changed by calling + the function `bond::SetDeserializeMaxDepth(uint32_t)`. +* Fixed handling of large containers of invalid types that could cause + excessive CPU use when deserializing some payloads. ### C# ### +* **Breaking change**: Update of Newtonsoft.Json library to version 13.3.0. +([Issue \#1156](https://github.com/microsoft/bond/issues/1156)) + + This update fixes depth check in input JSON string (by default: 64). + Depth check is necessary to prevent stack overflow issue with long payloads. +* **Breaking change**: The minimum supported version of .NET Framework is + 4.6.2. Support for .NET Framework 4.5 has been dropped. * **Breaking change**: All Bond-over-gRPC code has been removed. This is everything under the `Bond.Grpc` namespace and the Bond.Grpc.CSharp NuGet package. Service definitions can still appear in .bond files, but no C# @@ -48,6 +62,18 @@ different versioning scheme, following the Haskell community's [System.Collections.Immutable](https://learn.microsoft.com/dotnet/api/system.collections.immutable) collections. (Pull request [\#1161](https://github.com/microsoft/bond/pull/1161)) +* By default, deserialization will no longer process very deeply nested + structures. Instead, an `InvalidOperationException` will be thrown in + order to protect against stack overflows. The depth limit may be changed + by setting the property `Bond.DeserializerControls.Active.MaxDepth`. + +### Java ### + +* By default, deserialization will no longer process very deeply nested + structures. Instead, a `org.bondlib.InvalidBondDataException` exception + will be thrown in order to protect against stack overflows. The depth + limit may be changed by calling the method + `org.bondlib.bond.DeserializerControls.setMaxDepth`. ## 10.0: 2022-03-07 ## diff --git a/README.md b/README.md index 5f1139ee38..20e7363cbb 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,6 @@ For details, see the User's Manuals: * [C#](https://microsoft.github.io/bond/manual/bond_cs.html) * [Java](https://microsoft.github.io/bond/manual/bond_java.html) * [Python](https://microsoft.github.io/bond/manual/bond_py.html) -* [Bond-over-gRPC](https://microsoft.github.io/bond/manual/bond_over_grpc.html) - ([deprecated: will be removed in May - 2022](https://github.com/microsoft/bond/issues/1131)) * [`gbc`, the Bond compiler/codegen tool](https://microsoft.github.io/bond/manual/compiler.html) * See also [the compiler library](https://hackage.haskell.org/package/bond) that @@ -181,10 +178,10 @@ cmake .. \ Install the following tools: -- Visual Studio 2015 or 2017 - - VS2017 is required to build C# Bond from source -- .NET Core SDK ([https://www.microsoft.com/net/core](https://www.microsoft.com/net/core#windows)) - - Alternative to VS2017 for building C# Bond from source +- Visual Studio 2017 or newer. The following components are required: + - .NET Framework 4.6.2 targeting pack + - C++ development tools. A working C++ compiler is needed to build gbc. +- .NET SDK ([https://dotnet.microsoft.com/en-us/download](https://dotnet.microsoft.com/en-us/download)) - CMake ([http://www.cmake.org/download/](http://www.cmake.org/download/)) - Haskell Stack ([https://docs.haskellstack.org/en/stable/install_and_upgrade/#windows](https://docs.haskellstack.org/en/stable/install_and_upgrade/#windows)) @@ -199,7 +196,7 @@ Now you are ready to build the C# version of Bond. Open the solution file `cs\cs.sln` in Visual Studio and build as usual. The C# unit tests can also be run from within the solution. -To build using the .NET Core SDK: +To build using the .NET SDK: ```bash dotnet restore cs\cs.sln @@ -225,6 +222,22 @@ pre-built libraries are only needed for unit tests, and Python. If Boost or Python libraries are not found on the system, then some tests and examples will not be built. +You can also get an appropriate version of boost using the same approach as employed +by CI. The appveyor.yml file includes an invocation of: +``` +tools\ci-scripts\windows\Install-Boost.ps1 ` + -Version $env:BOND_BOOST ` + -VcToolSetVer $vcToolSetVer ` + -Components $boostComponents +``` +which can also be invoked manually in order to download the relevant version, e.g. +``` +Install-Boost.ps1 -Version 1.61.0 -VcToolSetVer 14.0 +``` +This will return the location to which the files were downloaded. It will be a temporary +location, so you should subsequently copy the directories to a more permanent location and +then configure your environment variables to point to those locations. + To generate a solution to build the Bond Core C++ and Python with Visual Studio 2015 run the following commands from the root `bond` directory: diff --git a/compiler/bond.cabal b/compiler/bond.cabal index 4edd6287bf..54a46594dc 100644 --- a/compiler/bond.cabal +++ b/compiler/bond.cabal @@ -1,13 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.34.4. +-- This file has been generated from package.yaml by hpack version 0.35.0. -- -- see: https://github.com/sol/hpack --- --- hash: b3e1e8755f812c54ff2252111e7b261404f305c68fbcdde72babcd762faf6acb name: bond -version: 0.12.1.0 +version: 0.13.0.0 synopsis: Bond schema compiler and code generator description: Bond is a cross-platform framework for handling schematized data. It supports cross-language de/serialization and powerful generic mechanisms for efficiently manipulating data. . This package contains a library for parsing the Bond schema definition language and performing template-based code generation. The library includes built-in templates for generating standard Bond C++ and C# code, as well as utilities for writing custom codegen templates. . The package also contains a command-line compiler/codegen tool, named gbc, which is primarily used to generate code for C++ and C# programs using Bond. category: Language, Compiler, Code Generation @@ -71,13 +69,13 @@ library , shakespeare , text , unordered-containers + default-language: Haskell2010 if os(windows) && arch(i386) ld-options: -Wl,--dynamicbase -Wl,--nxcompat -Wl,--large-address-aware if os(windows) && arch(x86_64) ld-options: -Wl,--dynamicbase -Wl,--nxcompat -Wl,--high-entropy-va if flag(warningsAsErrors) ghc-options: -Wall -Werror - default-language: Haskell2010 executable gbc main-is: Main.hs @@ -104,6 +102,7 @@ executable gbc , shakespeare , text , unordered-containers + default-language: Haskell2010 if os(windows) && arch(i386) ld-options: -Wl,--dynamicbase -Wl,--nxcompat -Wl,--large-address-aware if os(windows) && arch(x86_64) @@ -112,7 +111,6 @@ executable gbc ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Werror else ghc-options: -threaded -rtsopts -with-rtsopts=-N - default-language: Haskell2010 test-suite gbc-tests type: exitcode-stdio-1.0 @@ -153,6 +151,7 @@ test-suite gbc-tests , tasty-quickcheck , text , unordered-containers + default-language: Haskell2010 if os(windows) && arch(i386) ld-options: -Wl,--dynamicbase -Wl,--nxcompat -Wl,--large-address-aware if os(windows) && arch(x86_64) @@ -161,4 +160,3 @@ test-suite gbc-tests ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Werror else ghc-options: -threaded -rtsopts -with-rtsopts=-N - default-language: Haskell2010 diff --git a/compiler/package.yaml b/compiler/package.yaml index a8242f7c8e..04cead13d2 100644 --- a/compiler/package.yaml +++ b/compiler/package.yaml @@ -1,5 +1,5 @@ name: bond -version: 0.12.1.0 +version: 0.13.0.0 github: "microsoft/bond" license: MIT author: Adam Sapek diff --git a/compiler/src/Language/Bond/Codegen/Cpp/Types_h.hs b/compiler/src/Language/Bond/Codegen/Cpp/Types_h.hs index 03554917e9..021be189e9 100644 --- a/compiler/src/Language/Bond/Codegen/Cpp/Types_h.hs +++ b/compiler/src/Language/Bond/Codegen/Cpp/Types_h.hs @@ -39,7 +39,7 @@ types_h export_attribute userHeaders enumHeader allocator alloc_ctors_enabled ty #{newlineBeginSep 0 includeHeader userHeaders} #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/stack.yaml.lock b/compiler/stack.yaml.lock index 6092be05b5..5377cbaeff 100644 --- a/compiler/stack.yaml.lock +++ b/compiler/stack.yaml.lock @@ -7,13 +7,13 @@ packages: - completed: hackage: quickcheck-arbitrary-template-0.2.1.0@sha256:01f9deb34f8af3e6b879ee984b0be8803eb9c31e389490b5ddb8ca5fde32957c,2026 pantry-tree: - size: 625 sha256: a79d0b9f39f1096774a34f502c209dc70c85bc43f164e2925cb6b7a3f7ad82c8 + size: 625 original: hackage: quickcheck-arbitrary-template-0.2.1.0 snapshots: - completed: + sha256: 16f24be248b42c9e16d59db84378836b1e7c239448a041cae46d32daffa45a8b size: 523884 url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/14/4.yaml - sha256: 16f24be248b42c9e16d59db84378836b1e7c239448a041cae46d32daffa45a8b original: lts-14.4 diff --git a/compiler/tests/generated/alias_key_types.h b/compiler/tests/generated/alias_key_types.h index a80c6625f2..614d77161b 100644 --- a/compiler/tests/generated/alias_key_types.h +++ b/compiler/tests/generated/alias_key_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/alias_with_allocator_types.h b/compiler/tests/generated/alias_with_allocator_types.h index 2a0d1fef99..0afc80159e 100644 --- a/compiler/tests/generated/alias_with_allocator_types.h +++ b/compiler/tests/generated/alias_with_allocator_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/aliases_types.cs b/compiler/tests/generated/aliases_types.cs index 23452b8fb5..d7ed2cb0c9 100644 --- a/compiler/tests/generated/aliases_types.cs +++ b/compiler/tests/generated/aliases_types.cs @@ -18,7 +18,7 @@ namespace tests using System.Collections.Generic; [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Foo { [global::Bond.Id(0), global::Bond.Type(typeof(List>))] @@ -34,14 +34,14 @@ protected Foo(string fullName, string name) } } - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public enum EnumToWrap { anEnumValue, } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class WrappingAnEnum { [global::Bond.Id(0)] diff --git a/compiler/tests/generated/aliases_types.h b/compiler/tests/generated/aliases_types.h index 539e83ddac..0a4090b571 100644 --- a/compiler/tests/generated/aliases_types.h +++ b/compiler/tests/generated/aliases_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/alloc_ctors/alias_key_types.h b/compiler/tests/generated/alloc_ctors/alias_key_types.h index d7322f2294..fb4ee02c42 100644 --- a/compiler/tests/generated/alloc_ctors/alias_key_types.h +++ b/compiler/tests/generated/alloc_ctors/alias_key_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/alloc_ctors/aliases_types.h b/compiler/tests/generated/alloc_ctors/aliases_types.h index deb1ba004e..901d40289d 100644 --- a/compiler/tests/generated/alloc_ctors/aliases_types.h +++ b/compiler/tests/generated/alloc_ctors/aliases_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/alloc_ctors/attributes_types.h b/compiler/tests/generated/alloc_ctors/attributes_types.h index b46dc26f4d..fe2348231d 100644 --- a/compiler/tests/generated/alloc_ctors/attributes_types.h +++ b/compiler/tests/generated/alloc_ctors/attributes_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/alloc_ctors/basic_types_nsmapped_types.h b/compiler/tests/generated/alloc_ctors/basic_types_nsmapped_types.h index 1d310811cf..c5ede7da82 100644 --- a/compiler/tests/generated/alloc_ctors/basic_types_nsmapped_types.h +++ b/compiler/tests/generated/alloc_ctors/basic_types_nsmapped_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/alloc_ctors/basic_types_types.h b/compiler/tests/generated/alloc_ctors/basic_types_types.h index d383d768fc..1c553ef32f 100644 --- a/compiler/tests/generated/alloc_ctors/basic_types_types.h +++ b/compiler/tests/generated/alloc_ctors/basic_types_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/alloc_ctors/bond_meta_types.h b/compiler/tests/generated/alloc_ctors/bond_meta_types.h index fbe7d62782..5e5cc85350 100644 --- a/compiler/tests/generated/alloc_ctors/bond_meta_types.h +++ b/compiler/tests/generated/alloc_ctors/bond_meta_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/alloc_ctors/complex_types_types.h b/compiler/tests/generated/alloc_ctors/complex_types_types.h index dab17fbf64..4cd6183dc0 100644 --- a/compiler/tests/generated/alloc_ctors/complex_types_types.h +++ b/compiler/tests/generated/alloc_ctors/complex_types_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/alloc_ctors/defaults_types.h b/compiler/tests/generated/alloc_ctors/defaults_types.h index 3d09fefac7..a40c0ac265 100644 --- a/compiler/tests/generated/alloc_ctors/defaults_types.h +++ b/compiler/tests/generated/alloc_ctors/defaults_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/alloc_ctors/empty_types.h b/compiler/tests/generated/alloc_ctors/empty_types.h index 3adf7a668d..52f521388d 100644 --- a/compiler/tests/generated/alloc_ctors/empty_types.h +++ b/compiler/tests/generated/alloc_ctors/empty_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/alloc_ctors/field_modifiers_types.h b/compiler/tests/generated/alloc_ctors/field_modifiers_types.h index 21ce185006..073f795d7a 100644 --- a/compiler/tests/generated/alloc_ctors/field_modifiers_types.h +++ b/compiler/tests/generated/alloc_ctors/field_modifiers_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/alloc_ctors/generics_types.h b/compiler/tests/generated/alloc_ctors/generics_types.h index d8b6a91635..9c35219d38 100644 --- a/compiler/tests/generated/alloc_ctors/generics_types.h +++ b/compiler/tests/generated/alloc_ctors/generics_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/alloc_ctors/import_types.h b/compiler/tests/generated/alloc_ctors/import_types.h index 77b420a620..5d83c5cd05 100644 --- a/compiler/tests/generated/alloc_ctors/import_types.h +++ b/compiler/tests/generated/alloc_ctors/import_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/alloc_ctors/inheritance_types.h b/compiler/tests/generated/alloc_ctors/inheritance_types.h index 0a39bf51c7..b6dc61a09b 100644 --- a/compiler/tests/generated/alloc_ctors/inheritance_types.h +++ b/compiler/tests/generated/alloc_ctors/inheritance_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/alloc_ctors/maybe_blob_types.h b/compiler/tests/generated/alloc_ctors/maybe_blob_types.h index 3fd1aa9e14..50ad988e0f 100644 --- a/compiler/tests/generated/alloc_ctors/maybe_blob_types.h +++ b/compiler/tests/generated/alloc_ctors/maybe_blob_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/alloc_ctors/metadata_edge_cases_types.h b/compiler/tests/generated/alloc_ctors/metadata_edge_cases_types.h index 64ec4ffc60..1717d69e76 100644 --- a/compiler/tests/generated/alloc_ctors/metadata_edge_cases_types.h +++ b/compiler/tests/generated/alloc_ctors/metadata_edge_cases_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/alloc_ctors/with_enum_header_types.h b/compiler/tests/generated/alloc_ctors/with_enum_header_types.h index 0b5aa66fd3..c98baa4c9f 100644 --- a/compiler/tests/generated/alloc_ctors/with_enum_header_types.h +++ b/compiler/tests/generated/alloc_ctors/with_enum_header_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/allocator/alias_key_types.h b/compiler/tests/generated/allocator/alias_key_types.h index 40ea07b789..fcd6a2bbe8 100644 --- a/compiler/tests/generated/allocator/alias_key_types.h +++ b/compiler/tests/generated/allocator/alias_key_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/allocator/aliases_types.h b/compiler/tests/generated/allocator/aliases_types.h index 3e5741582c..5802f622b8 100644 --- a/compiler/tests/generated/allocator/aliases_types.h +++ b/compiler/tests/generated/allocator/aliases_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/allocator/attributes_types.h b/compiler/tests/generated/allocator/attributes_types.h index 6af992d41b..2429fabba1 100644 --- a/compiler/tests/generated/allocator/attributes_types.h +++ b/compiler/tests/generated/allocator/attributes_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/allocator/basic_types_nsmapped_types.h b/compiler/tests/generated/allocator/basic_types_nsmapped_types.h index 2edda3f6bf..eb6ffab9a9 100644 --- a/compiler/tests/generated/allocator/basic_types_nsmapped_types.h +++ b/compiler/tests/generated/allocator/basic_types_nsmapped_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/allocator/basic_types_types.h b/compiler/tests/generated/allocator/basic_types_types.h index f21671218d..444f053caa 100644 --- a/compiler/tests/generated/allocator/basic_types_types.h +++ b/compiler/tests/generated/allocator/basic_types_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/allocator/bond_meta_types.h b/compiler/tests/generated/allocator/bond_meta_types.h index 5931283ea9..61d165f410 100644 --- a/compiler/tests/generated/allocator/bond_meta_types.h +++ b/compiler/tests/generated/allocator/bond_meta_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/allocator/complex_types_types.h b/compiler/tests/generated/allocator/complex_types_types.h index ac862a500d..79bf9cfea7 100644 --- a/compiler/tests/generated/allocator/complex_types_types.h +++ b/compiler/tests/generated/allocator/complex_types_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/allocator/defaults_types.h b/compiler/tests/generated/allocator/defaults_types.h index 5715dfb85c..f2e1e32963 100644 --- a/compiler/tests/generated/allocator/defaults_types.h +++ b/compiler/tests/generated/allocator/defaults_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/allocator/empty_types.h b/compiler/tests/generated/allocator/empty_types.h index 3adf7a668d..52f521388d 100644 --- a/compiler/tests/generated/allocator/empty_types.h +++ b/compiler/tests/generated/allocator/empty_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/allocator/field_modifiers_types.h b/compiler/tests/generated/allocator/field_modifiers_types.h index f5b81fdf3c..537fe2582b 100644 --- a/compiler/tests/generated/allocator/field_modifiers_types.h +++ b/compiler/tests/generated/allocator/field_modifiers_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/allocator/generics_types.h b/compiler/tests/generated/allocator/generics_types.h index 5134888015..291f4ad9d8 100644 --- a/compiler/tests/generated/allocator/generics_types.h +++ b/compiler/tests/generated/allocator/generics_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/allocator/import_types.h b/compiler/tests/generated/allocator/import_types.h index d9960a1395..04c0c3fb2e 100644 --- a/compiler/tests/generated/allocator/import_types.h +++ b/compiler/tests/generated/allocator/import_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/allocator/inheritance_types.h b/compiler/tests/generated/allocator/inheritance_types.h index 06df25369d..1dd4e91559 100644 --- a/compiler/tests/generated/allocator/inheritance_types.h +++ b/compiler/tests/generated/allocator/inheritance_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/allocator/maybe_blob_types.h b/compiler/tests/generated/allocator/maybe_blob_types.h index b89dfe5957..18ea380adc 100644 --- a/compiler/tests/generated/allocator/maybe_blob_types.h +++ b/compiler/tests/generated/allocator/maybe_blob_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/allocator/metadata_edge_cases_types.h b/compiler/tests/generated/allocator/metadata_edge_cases_types.h index 99ee93c99d..9d6cbd841a 100644 --- a/compiler/tests/generated/allocator/metadata_edge_cases_types.h +++ b/compiler/tests/generated/allocator/metadata_edge_cases_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/allocator/with_enum_header_types.h b/compiler/tests/generated/allocator/with_enum_header_types.h index beaf30a2f1..11c29866a9 100644 --- a/compiler/tests/generated/allocator/with_enum_header_types.h +++ b/compiler/tests/generated/allocator/with_enum_header_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/attributes_types.cs b/compiler/tests/generated/attributes_types.cs index 4a4e9abc0d..6757ba3f84 100644 --- a/compiler/tests/generated/attributes_types.cs +++ b/compiler/tests/generated/attributes_types.cs @@ -19,7 +19,7 @@ namespace tests [global::Bond.Attribute("EnumAttribute1", "one")] [global::Bond.Attribute("EnumAttribute2", "two")] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public enum Enum { Value1, @@ -28,7 +28,7 @@ public enum Enum [global::Bond.Attribute("StructAttribute1", "one")] [global::Bond.Attribute("StructAttribute2", "two")] [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Foo { [global::Bond.Attribute("FieldAttribute1", "one")] diff --git a/compiler/tests/generated/attributes_types.h b/compiler/tests/generated/attributes_types.h index 7ed174cfae..cdd7c416a9 100644 --- a/compiler/tests/generated/attributes_types.h +++ b/compiler/tests/generated/attributes_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/basic_types_nsmapped_types.cs b/compiler/tests/generated/basic_types_nsmapped_types.cs index 10bd9320e3..2c349b9d67 100644 --- a/compiler/tests/generated/basic_types_nsmapped_types.cs +++ b/compiler/tests/generated/basic_types_nsmapped_types.cs @@ -19,7 +19,7 @@ namespace nsmapped [global::Bond.Namespace("tests")] [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class BasicTypes { [global::Bond.Id(0)] diff --git a/compiler/tests/generated/basic_types_nsmapped_types.h b/compiler/tests/generated/basic_types_nsmapped_types.h index 9421251eb9..b3b1bebcad 100644 --- a/compiler/tests/generated/basic_types_nsmapped_types.h +++ b/compiler/tests/generated/basic_types_nsmapped_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/basic_types_types.cs b/compiler/tests/generated/basic_types_types.cs index 38131a387b..effb2fc1be 100644 --- a/compiler/tests/generated/basic_types_types.cs +++ b/compiler/tests/generated/basic_types_types.cs @@ -18,7 +18,7 @@ namespace tests using System.Collections.Generic; [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class BasicTypes { [global::Bond.Id(0)] diff --git a/compiler/tests/generated/basic_types_types.h b/compiler/tests/generated/basic_types_types.h index 5433a33236..eeab909d18 100644 --- a/compiler/tests/generated/basic_types_types.h +++ b/compiler/tests/generated/basic_types_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/bond_meta_types.cs b/compiler/tests/generated/bond_meta_types.cs index f9c954d9fd..ef79bc8da4 100644 --- a/compiler/tests/generated/bond_meta_types.cs +++ b/compiler/tests/generated/bond_meta_types.cs @@ -18,7 +18,7 @@ namespace deprecated.bondmeta using System.Collections.Generic; [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class HasMetaFields { [global::Bond.Id(0), global::Bond.RequiredOptional] diff --git a/compiler/tests/generated/bond_meta_types.h b/compiler/tests/generated/bond_meta_types.h index 9d36b81f38..1351d422a2 100644 --- a/compiler/tests/generated/bond_meta_types.h +++ b/compiler/tests/generated/bond_meta_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/collection-interfaces/aliases_types.cs b/compiler/tests/generated/collection-interfaces/aliases_types.cs index 679a30a6f7..1e3384b8b2 100644 --- a/compiler/tests/generated/collection-interfaces/aliases_types.cs +++ b/compiler/tests/generated/collection-interfaces/aliases_types.cs @@ -18,7 +18,7 @@ namespace tests using System.Collections.Generic; [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Foo { [global::Bond.Id(0), global::Bond.Type(typeof(List>))] @@ -34,14 +34,14 @@ protected Foo(string fullName, string name) } } - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public enum EnumToWrap { anEnumValue, } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class WrappingAnEnum { [global::Bond.Id(0)] diff --git a/compiler/tests/generated/collection-interfaces/attributes_types.cs b/compiler/tests/generated/collection-interfaces/attributes_types.cs index 4a4e9abc0d..6757ba3f84 100644 --- a/compiler/tests/generated/collection-interfaces/attributes_types.cs +++ b/compiler/tests/generated/collection-interfaces/attributes_types.cs @@ -19,7 +19,7 @@ namespace tests [global::Bond.Attribute("EnumAttribute1", "one")] [global::Bond.Attribute("EnumAttribute2", "two")] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public enum Enum { Value1, @@ -28,7 +28,7 @@ public enum Enum [global::Bond.Attribute("StructAttribute1", "one")] [global::Bond.Attribute("StructAttribute2", "two")] [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Foo { [global::Bond.Attribute("FieldAttribute1", "one")] diff --git a/compiler/tests/generated/collection-interfaces/basic_types_nsmapped_types.cs b/compiler/tests/generated/collection-interfaces/basic_types_nsmapped_types.cs index 10bd9320e3..2c349b9d67 100644 --- a/compiler/tests/generated/collection-interfaces/basic_types_nsmapped_types.cs +++ b/compiler/tests/generated/collection-interfaces/basic_types_nsmapped_types.cs @@ -19,7 +19,7 @@ namespace nsmapped [global::Bond.Namespace("tests")] [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class BasicTypes { [global::Bond.Id(0)] diff --git a/compiler/tests/generated/collection-interfaces/basic_types_types.cs b/compiler/tests/generated/collection-interfaces/basic_types_types.cs index 38131a387b..effb2fc1be 100644 --- a/compiler/tests/generated/collection-interfaces/basic_types_types.cs +++ b/compiler/tests/generated/collection-interfaces/basic_types_types.cs @@ -18,7 +18,7 @@ namespace tests using System.Collections.Generic; [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class BasicTypes { [global::Bond.Id(0)] diff --git a/compiler/tests/generated/collection-interfaces/bond_meta_types.cs b/compiler/tests/generated/collection-interfaces/bond_meta_types.cs index f9c954d9fd..ef79bc8da4 100644 --- a/compiler/tests/generated/collection-interfaces/bond_meta_types.cs +++ b/compiler/tests/generated/collection-interfaces/bond_meta_types.cs @@ -18,7 +18,7 @@ namespace deprecated.bondmeta using System.Collections.Generic; [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class HasMetaFields { [global::Bond.Id(0), global::Bond.RequiredOptional] diff --git a/compiler/tests/generated/collection-interfaces/complex_inheritance_types.cs b/compiler/tests/generated/collection-interfaces/complex_inheritance_types.cs index 48243dca25..c799018b24 100644 --- a/compiler/tests/generated/collection-interfaces/complex_inheritance_types.cs +++ b/compiler/tests/generated/collection-interfaces/complex_inheritance_types.cs @@ -17,7 +17,7 @@ namespace Test { using System.Collections.Generic; - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public enum TestEnum { EnumVal1, @@ -26,7 +26,7 @@ public enum TestEnum } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Simple { [global::Bond.Id(0)] @@ -49,7 +49,7 @@ protected Simple(string fullName, string name) } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Foo { [global::Bond.Id(0), global::Bond.Type(typeof(global::Bond.Tag.wstring))] @@ -66,7 +66,7 @@ protected Foo(string fullName, string name) } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Bar : Foo { @@ -107,7 +107,7 @@ protected Bar(string fullName, string name) } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Baz : Bar { @@ -133,7 +133,7 @@ protected Baz(string fullName, string name) } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class DerivedEmpty : Foo { diff --git a/compiler/tests/generated/collection-interfaces/complex_types_types.cs b/compiler/tests/generated/collection-interfaces/complex_types_types.cs index 58c2d24c71..eb370e29ca 100644 --- a/compiler/tests/generated/collection-interfaces/complex_types_types.cs +++ b/compiler/tests/generated/collection-interfaces/complex_types_types.cs @@ -18,14 +18,14 @@ namespace tests using System.Collections.Generic; [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Foo { } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class ComplexTypes { [global::Bond.Id(0), global::Bond.Type(typeof(LinkedList))] diff --git a/compiler/tests/generated/collection-interfaces/defaults_types.cs b/compiler/tests/generated/collection-interfaces/defaults_types.cs index aa0ade7abb..f033f9f6d7 100644 --- a/compiler/tests/generated/collection-interfaces/defaults_types.cs +++ b/compiler/tests/generated/collection-interfaces/defaults_types.cs @@ -17,7 +17,7 @@ namespace tests { using System.Collections.Generic; - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public enum EnumType1 { EnumValue1 = unchecked((int)5), @@ -36,7 +36,7 @@ public enum EnumType1 } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Foo { [global::Bond.Id(0)] diff --git a/compiler/tests/generated/collection-interfaces/field_modifiers_types.cs b/compiler/tests/generated/collection-interfaces/field_modifiers_types.cs index c3dce96526..db230462ac 100644 --- a/compiler/tests/generated/collection-interfaces/field_modifiers_types.cs +++ b/compiler/tests/generated/collection-interfaces/field_modifiers_types.cs @@ -18,7 +18,7 @@ namespace tests using System.Collections.Generic; [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Foo { [global::Bond.Id(0)] diff --git a/compiler/tests/generated/collection-interfaces/generics_types.cs b/compiler/tests/generated/collection-interfaces/generics_types.cs index 42e1a4602d..7ef78f6ea3 100644 --- a/compiler/tests/generated/collection-interfaces/generics_types.cs +++ b/compiler/tests/generated/collection-interfaces/generics_types.cs @@ -18,7 +18,7 @@ namespace tests using System.Collections.Generic; [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Foo where T2 : struct { diff --git a/compiler/tests/generated/collection-interfaces/immutable_collections_types.cs b/compiler/tests/generated/collection-interfaces/immutable_collections_types.cs index db9d74dc04..85c20da4db 100644 --- a/compiler/tests/generated/collection-interfaces/immutable_collections_types.cs +++ b/compiler/tests/generated/collection-interfaces/immutable_collections_types.cs @@ -18,7 +18,7 @@ namespace tests using System.Collections.Generic; [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class ImmutableCollectionsHolder { [global::Bond.Id(0)] diff --git a/compiler/tests/generated/collection-interfaces/import_types.cs b/compiler/tests/generated/collection-interfaces/import_types.cs index 2d511e0b1a..4c2e9d0979 100644 --- a/compiler/tests/generated/collection-interfaces/import_types.cs +++ b/compiler/tests/generated/collection-interfaces/import_types.cs @@ -18,7 +18,7 @@ namespace import_test using System.Collections.Generic; [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class HasEmpty { [global::Bond.Id(0)] diff --git a/compiler/tests/generated/collection-interfaces/inheritance_types.cs b/compiler/tests/generated/collection-interfaces/inheritance_types.cs index 8500aeaea4..2f66d46502 100644 --- a/compiler/tests/generated/collection-interfaces/inheritance_types.cs +++ b/compiler/tests/generated/collection-interfaces/inheritance_types.cs @@ -18,7 +18,7 @@ namespace tests using System.Collections.Generic; [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Base { [global::Bond.Id(0)] @@ -35,7 +35,7 @@ protected Base(string fullName, string name) } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Foo : Base { diff --git a/compiler/tests/generated/collection-interfaces/nullable_alias_types.cs b/compiler/tests/generated/collection-interfaces/nullable_alias_types.cs index 1a20ca21c2..ac972cfce4 100644 --- a/compiler/tests/generated/collection-interfaces/nullable_alias_types.cs +++ b/compiler/tests/generated/collection-interfaces/nullable_alias_types.cs @@ -18,7 +18,7 @@ namespace test using System.Collections.Generic; [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class foo { [global::Bond.Id(1), global::Bond.Type(typeof(global::Bond.Tag.nullable))] diff --git a/compiler/tests/generated/complex_inheritance_types.cs b/compiler/tests/generated/complex_inheritance_types.cs index 2ec360eb77..db9572c89d 100644 --- a/compiler/tests/generated/complex_inheritance_types.cs +++ b/compiler/tests/generated/complex_inheritance_types.cs @@ -17,7 +17,7 @@ namespace Test { using System.Collections.Generic; - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public enum TestEnum { EnumVal1, @@ -26,7 +26,7 @@ public enum TestEnum } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Simple { [global::Bond.Id(0)] @@ -49,7 +49,7 @@ protected Simple(string fullName, string name) } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Foo { [global::Bond.Id(0), global::Bond.Type(typeof(global::Bond.Tag.wstring))] @@ -66,7 +66,7 @@ protected Foo(string fullName, string name) } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Bar : Foo { @@ -107,7 +107,7 @@ protected Bar(string fullName, string name) } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Baz : Bar { @@ -133,7 +133,7 @@ protected Baz(string fullName, string name) } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class DerivedEmpty : Foo { diff --git a/compiler/tests/generated/complex_types_types.cs b/compiler/tests/generated/complex_types_types.cs index b91ec8ec31..134a776bf9 100644 --- a/compiler/tests/generated/complex_types_types.cs +++ b/compiler/tests/generated/complex_types_types.cs @@ -18,14 +18,14 @@ namespace tests using System.Collections.Generic; [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Foo { } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class ComplexTypes { [global::Bond.Id(0)] diff --git a/compiler/tests/generated/complex_types_types.h b/compiler/tests/generated/complex_types_types.h index 4723b505f6..45c08c6a59 100644 --- a/compiler/tests/generated/complex_types_types.h +++ b/compiler/tests/generated/complex_types_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/constructor-parameters/collection-interfaces/complex_inheritance_types.cs b/compiler/tests/generated/constructor-parameters/collection-interfaces/complex_inheritance_types.cs index 739a6a04ba..47ba41bf47 100644 --- a/compiler/tests/generated/constructor-parameters/collection-interfaces/complex_inheritance_types.cs +++ b/compiler/tests/generated/constructor-parameters/collection-interfaces/complex_inheritance_types.cs @@ -17,7 +17,7 @@ namespace Test { using System.Collections.Generic; - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public enum TestEnum { EnumVal1, @@ -26,7 +26,7 @@ public enum TestEnum } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Simple { [global::Bond.Id(0)] @@ -55,7 +55,7 @@ public Simple() } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Foo { [global::Bond.Id(0), global::Bond.Type(typeof(global::Bond.Tag.wstring))] @@ -74,7 +74,7 @@ public Foo() } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Bar : Foo { @@ -135,7 +135,7 @@ public Bar() } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Baz : Bar { @@ -187,7 +187,7 @@ public Baz() } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class DerivedEmpty : Foo { diff --git a/compiler/tests/generated/constructor-parameters/collection-interfaces/empty_struct_types.cs b/compiler/tests/generated/constructor-parameters/collection-interfaces/empty_struct_types.cs index eddf7b0689..799c4a4894 100644 --- a/compiler/tests/generated/constructor-parameters/collection-interfaces/empty_struct_types.cs +++ b/compiler/tests/generated/constructor-parameters/collection-interfaces/empty_struct_types.cs @@ -18,7 +18,7 @@ namespace tests using System.Collections.Generic; [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Empty { diff --git a/compiler/tests/generated/constructor-parameters/complex_inheritance_types.cs b/compiler/tests/generated/constructor-parameters/complex_inheritance_types.cs index 26c4be2e2b..e97991eee0 100644 --- a/compiler/tests/generated/constructor-parameters/complex_inheritance_types.cs +++ b/compiler/tests/generated/constructor-parameters/complex_inheritance_types.cs @@ -17,7 +17,7 @@ namespace Test { using System.Collections.Generic; - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public enum TestEnum { EnumVal1, @@ -26,7 +26,7 @@ public enum TestEnum } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Simple { [global::Bond.Id(0)] @@ -55,7 +55,7 @@ public Simple() } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Foo { [global::Bond.Id(0), global::Bond.Type(typeof(global::Bond.Tag.wstring))] @@ -74,7 +74,7 @@ public Foo() } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Bar : Foo { @@ -135,7 +135,7 @@ public Bar() } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Baz : Bar { @@ -187,7 +187,7 @@ public Baz() } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class DerivedEmpty : Foo { diff --git a/compiler/tests/generated/constructor-parameters/empty_struct_types.cs b/compiler/tests/generated/constructor-parameters/empty_struct_types.cs index eddf7b0689..799c4a4894 100644 --- a/compiler/tests/generated/constructor-parameters/empty_struct_types.cs +++ b/compiler/tests/generated/constructor-parameters/empty_struct_types.cs @@ -18,7 +18,7 @@ namespace tests using System.Collections.Generic; [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Empty { diff --git a/compiler/tests/generated/constructor-parameters_fields/collection-interfaces/complex_inheritance_types.cs b/compiler/tests/generated/constructor-parameters_fields/collection-interfaces/complex_inheritance_types.cs index b829044323..86184feb63 100644 --- a/compiler/tests/generated/constructor-parameters_fields/collection-interfaces/complex_inheritance_types.cs +++ b/compiler/tests/generated/constructor-parameters_fields/collection-interfaces/complex_inheritance_types.cs @@ -17,7 +17,7 @@ namespace Test { using System.Collections.Generic; - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public enum TestEnum { EnumVal1, @@ -26,7 +26,7 @@ public enum TestEnum } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Simple { [global::Bond.Id(0)] @@ -55,7 +55,7 @@ public Simple() } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Foo { [global::Bond.Id(0), global::Bond.Type(typeof(global::Bond.Tag.wstring))] @@ -74,7 +74,7 @@ public Foo() } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Bar : Foo { @@ -130,7 +130,7 @@ public Bar() } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Baz : Bar { @@ -180,7 +180,7 @@ public Baz() } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class DerivedEmpty : Foo { diff --git a/compiler/tests/generated/constructor-parameters_fields/complex_inheritance_types.cs b/compiler/tests/generated/constructor-parameters_fields/complex_inheritance_types.cs index f048e121a1..109fe8e509 100644 --- a/compiler/tests/generated/constructor-parameters_fields/complex_inheritance_types.cs +++ b/compiler/tests/generated/constructor-parameters_fields/complex_inheritance_types.cs @@ -17,7 +17,7 @@ namespace Test { using System.Collections.Generic; - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public enum TestEnum { EnumVal1, @@ -26,7 +26,7 @@ public enum TestEnum } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Simple { [global::Bond.Id(0)] @@ -55,7 +55,7 @@ public Simple() } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Foo { [global::Bond.Id(0), global::Bond.Type(typeof(global::Bond.Tag.wstring))] @@ -74,7 +74,7 @@ public Foo() } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Bar : Foo { @@ -130,7 +130,7 @@ public Bar() } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Baz : Bar { @@ -180,7 +180,7 @@ public Baz() } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class DerivedEmpty : Foo { diff --git a/compiler/tests/generated/custom_alias_with_allocator_types.h b/compiler/tests/generated/custom_alias_with_allocator_types.h index e511bf462e..da427736b6 100644 --- a/compiler/tests/generated/custom_alias_with_allocator_types.h +++ b/compiler/tests/generated/custom_alias_with_allocator_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/custom_alias_without_allocator_types.h b/compiler/tests/generated/custom_alias_without_allocator_types.h index 930d749941..3b9b9f6518 100644 --- a/compiler/tests/generated/custom_alias_without_allocator_types.h +++ b/compiler/tests/generated/custom_alias_without_allocator_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/defaults_types.cs b/compiler/tests/generated/defaults_types.cs index aa0ade7abb..f033f9f6d7 100644 --- a/compiler/tests/generated/defaults_types.cs +++ b/compiler/tests/generated/defaults_types.cs @@ -17,7 +17,7 @@ namespace tests { using System.Collections.Generic; - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public enum EnumType1 { EnumValue1 = unchecked((int)5), @@ -36,7 +36,7 @@ public enum EnumType1 } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Foo { [global::Bond.Id(0)] diff --git a/compiler/tests/generated/defaults_types.h b/compiler/tests/generated/defaults_types.h index 62df5ce0cd..8792782711 100644 --- a/compiler/tests/generated/defaults_types.h +++ b/compiler/tests/generated/defaults_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/empty_types.h b/compiler/tests/generated/empty_types.h index 3adf7a668d..52f521388d 100644 --- a/compiler/tests/generated/empty_types.h +++ b/compiler/tests/generated/empty_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/exports/with_enum_header_types.h b/compiler/tests/generated/exports/with_enum_header_types.h index a9d496d92c..ae15306915 100644 --- a/compiler/tests/generated/exports/with_enum_header_types.h +++ b/compiler/tests/generated/exports/with_enum_header_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/field_modifiers_types.cs b/compiler/tests/generated/field_modifiers_types.cs index c3dce96526..db230462ac 100644 --- a/compiler/tests/generated/field_modifiers_types.cs +++ b/compiler/tests/generated/field_modifiers_types.cs @@ -18,7 +18,7 @@ namespace tests using System.Collections.Generic; [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Foo { [global::Bond.Id(0)] diff --git a/compiler/tests/generated/field_modifiers_types.h b/compiler/tests/generated/field_modifiers_types.h index 0058250c4e..fa03387584 100644 --- a/compiler/tests/generated/field_modifiers_types.h +++ b/compiler/tests/generated/field_modifiers_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/generics_types.cs b/compiler/tests/generated/generics_types.cs index 42e1a4602d..7ef78f6ea3 100644 --- a/compiler/tests/generated/generics_types.cs +++ b/compiler/tests/generated/generics_types.cs @@ -18,7 +18,7 @@ namespace tests using System.Collections.Generic; [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Foo where T2 : struct { diff --git a/compiler/tests/generated/generics_types.h b/compiler/tests/generated/generics_types.h index 8fb2a2dfc1..ce80c59f71 100644 --- a/compiler/tests/generated/generics_types.h +++ b/compiler/tests/generated/generics_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/immutable_collections_types.cs b/compiler/tests/generated/immutable_collections_types.cs index db9d74dc04..85c20da4db 100644 --- a/compiler/tests/generated/immutable_collections_types.cs +++ b/compiler/tests/generated/immutable_collections_types.cs @@ -18,7 +18,7 @@ namespace tests using System.Collections.Generic; [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class ImmutableCollectionsHolder { [global::Bond.Id(0)] diff --git a/compiler/tests/generated/import_types.cs b/compiler/tests/generated/import_types.cs index 2d511e0b1a..4c2e9d0979 100644 --- a/compiler/tests/generated/import_types.cs +++ b/compiler/tests/generated/import_types.cs @@ -18,7 +18,7 @@ namespace import_test using System.Collections.Generic; [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class HasEmpty { [global::Bond.Id(0)] diff --git a/compiler/tests/generated/import_types.h b/compiler/tests/generated/import_types.h index b90572d8a3..5c6108b2cf 100644 --- a/compiler/tests/generated/import_types.h +++ b/compiler/tests/generated/import_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/inheritance_types.cs b/compiler/tests/generated/inheritance_types.cs index 8500aeaea4..2f66d46502 100644 --- a/compiler/tests/generated/inheritance_types.cs +++ b/compiler/tests/generated/inheritance_types.cs @@ -18,7 +18,7 @@ namespace tests using System.Collections.Generic; [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Base { [global::Bond.Id(0)] @@ -35,7 +35,7 @@ protected Base(string fullName, string name) } [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class Foo : Base { diff --git a/compiler/tests/generated/inheritance_types.h b/compiler/tests/generated/inheritance_types.h index 2e7ead32f5..1914a45073 100644 --- a/compiler/tests/generated/inheritance_types.h +++ b/compiler/tests/generated/inheritance_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/maybe_blob_types.h b/compiler/tests/generated/maybe_blob_types.h index 1ace9b9906..2525008edd 100644 --- a/compiler/tests/generated/maybe_blob_types.h +++ b/compiler/tests/generated/maybe_blob_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/metadata_edge_cases_types.h b/compiler/tests/generated/metadata_edge_cases_types.h index ff6bb92945..844f439bd9 100644 --- a/compiler/tests/generated/metadata_edge_cases_types.h +++ b/compiler/tests/generated/metadata_edge_cases_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/nullable_alias_types.cs b/compiler/tests/generated/nullable_alias_types.cs index 1a20ca21c2..ac972cfce4 100644 --- a/compiler/tests/generated/nullable_alias_types.cs +++ b/compiler/tests/generated/nullable_alias_types.cs @@ -18,7 +18,7 @@ namespace test using System.Collections.Generic; [global::Bond.Schema] - [System.CodeDom.Compiler.GeneratedCode("gbc", "0.12.1.0")] + [System.CodeDom.Compiler.GeneratedCode("gbc", "0.13.0.0")] public partial class foo { [global::Bond.Id(1), global::Bond.Type(typeof(global::Bond.Tag.nullable))] diff --git a/compiler/tests/generated/scoped_allocator/alias_key_types.h b/compiler/tests/generated/scoped_allocator/alias_key_types.h index 76391f88af..82961e67e6 100644 --- a/compiler/tests/generated/scoped_allocator/alias_key_types.h +++ b/compiler/tests/generated/scoped_allocator/alias_key_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/scoped_allocator/aliases_types.h b/compiler/tests/generated/scoped_allocator/aliases_types.h index 2b000917ea..4f34ea1cf1 100644 --- a/compiler/tests/generated/scoped_allocator/aliases_types.h +++ b/compiler/tests/generated/scoped_allocator/aliases_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/scoped_allocator/attributes_types.h b/compiler/tests/generated/scoped_allocator/attributes_types.h index 2616967359..15f515af51 100644 --- a/compiler/tests/generated/scoped_allocator/attributes_types.h +++ b/compiler/tests/generated/scoped_allocator/attributes_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/scoped_allocator/basic_types_nsmapped_types.h b/compiler/tests/generated/scoped_allocator/basic_types_nsmapped_types.h index c483d71c67..110275bc39 100644 --- a/compiler/tests/generated/scoped_allocator/basic_types_nsmapped_types.h +++ b/compiler/tests/generated/scoped_allocator/basic_types_nsmapped_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/scoped_allocator/basic_types_types.h b/compiler/tests/generated/scoped_allocator/basic_types_types.h index fecdc28830..4642dd0cf6 100644 --- a/compiler/tests/generated/scoped_allocator/basic_types_types.h +++ b/compiler/tests/generated/scoped_allocator/basic_types_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/scoped_allocator/bond_meta_types.h b/compiler/tests/generated/scoped_allocator/bond_meta_types.h index 81f9cba5e7..6b3b70fdfb 100644 --- a/compiler/tests/generated/scoped_allocator/bond_meta_types.h +++ b/compiler/tests/generated/scoped_allocator/bond_meta_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/scoped_allocator/complex_types_types.h b/compiler/tests/generated/scoped_allocator/complex_types_types.h index 2e30a62c56..df2ba5575e 100644 --- a/compiler/tests/generated/scoped_allocator/complex_types_types.h +++ b/compiler/tests/generated/scoped_allocator/complex_types_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/scoped_allocator/defaults_types.h b/compiler/tests/generated/scoped_allocator/defaults_types.h index 35d60d5fb6..8fbc0d9794 100644 --- a/compiler/tests/generated/scoped_allocator/defaults_types.h +++ b/compiler/tests/generated/scoped_allocator/defaults_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/scoped_allocator/empty_types.h b/compiler/tests/generated/scoped_allocator/empty_types.h index 3adf7a668d..52f521388d 100644 --- a/compiler/tests/generated/scoped_allocator/empty_types.h +++ b/compiler/tests/generated/scoped_allocator/empty_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/scoped_allocator/field_modifiers_types.h b/compiler/tests/generated/scoped_allocator/field_modifiers_types.h index f5b81fdf3c..537fe2582b 100644 --- a/compiler/tests/generated/scoped_allocator/field_modifiers_types.h +++ b/compiler/tests/generated/scoped_allocator/field_modifiers_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/scoped_allocator/generics_types.h b/compiler/tests/generated/scoped_allocator/generics_types.h index 5134888015..291f4ad9d8 100644 --- a/compiler/tests/generated/scoped_allocator/generics_types.h +++ b/compiler/tests/generated/scoped_allocator/generics_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/scoped_allocator/import_types.h b/compiler/tests/generated/scoped_allocator/import_types.h index d9960a1395..04c0c3fb2e 100644 --- a/compiler/tests/generated/scoped_allocator/import_types.h +++ b/compiler/tests/generated/scoped_allocator/import_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/scoped_allocator/inheritance_types.h b/compiler/tests/generated/scoped_allocator/inheritance_types.h index 06df25369d..1dd4e91559 100644 --- a/compiler/tests/generated/scoped_allocator/inheritance_types.h +++ b/compiler/tests/generated/scoped_allocator/inheritance_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/scoped_allocator/maybe_blob_types.h b/compiler/tests/generated/scoped_allocator/maybe_blob_types.h index b89dfe5957..18ea380adc 100644 --- a/compiler/tests/generated/scoped_allocator/maybe_blob_types.h +++ b/compiler/tests/generated/scoped_allocator/maybe_blob_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/scoped_allocator/metadata_edge_cases_types.h b/compiler/tests/generated/scoped_allocator/metadata_edge_cases_types.h index 99ee93c99d..9d6cbd841a 100644 --- a/compiler/tests/generated/scoped_allocator/metadata_edge_cases_types.h +++ b/compiler/tests/generated/scoped_allocator/metadata_edge_cases_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/scoped_allocator/with_enum_header_types.h b/compiler/tests/generated/scoped_allocator/with_enum_header_types.h index 2113da2b18..1a2d366170 100644 --- a/compiler/tests/generated/scoped_allocator/with_enum_header_types.h +++ b/compiler/tests/generated/scoped_allocator/with_enum_header_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/type_aliases/alias_key_types.h b/compiler/tests/generated/type_aliases/alias_key_types.h index 0b1f53f2b3..c594316ba5 100644 --- a/compiler/tests/generated/type_aliases/alias_key_types.h +++ b/compiler/tests/generated/type_aliases/alias_key_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/type_aliases/alias_with_allocator_types.h b/compiler/tests/generated/type_aliases/alias_with_allocator_types.h index 80c33e2e37..2a5faad85f 100644 --- a/compiler/tests/generated/type_aliases/alias_with_allocator_types.h +++ b/compiler/tests/generated/type_aliases/alias_with_allocator_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/type_aliases/aliases_types.h b/compiler/tests/generated/type_aliases/aliases_types.h index 270a0719b2..621678137b 100644 --- a/compiler/tests/generated/type_aliases/aliases_types.h +++ b/compiler/tests/generated/type_aliases/aliases_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/type_aliases/attributes_types.h b/compiler/tests/generated/type_aliases/attributes_types.h index 6af992d41b..2429fabba1 100644 --- a/compiler/tests/generated/type_aliases/attributes_types.h +++ b/compiler/tests/generated/type_aliases/attributes_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/type_aliases/basic_types_nsmapped_types.h b/compiler/tests/generated/type_aliases/basic_types_nsmapped_types.h index 2edda3f6bf..eb6ffab9a9 100644 --- a/compiler/tests/generated/type_aliases/basic_types_nsmapped_types.h +++ b/compiler/tests/generated/type_aliases/basic_types_nsmapped_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/type_aliases/basic_types_types.h b/compiler/tests/generated/type_aliases/basic_types_types.h index f21671218d..444f053caa 100644 --- a/compiler/tests/generated/type_aliases/basic_types_types.h +++ b/compiler/tests/generated/type_aliases/basic_types_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/type_aliases/bond_meta_types.h b/compiler/tests/generated/type_aliases/bond_meta_types.h index 5931283ea9..61d165f410 100644 --- a/compiler/tests/generated/type_aliases/bond_meta_types.h +++ b/compiler/tests/generated/type_aliases/bond_meta_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/type_aliases/complex_types_types.h b/compiler/tests/generated/type_aliases/complex_types_types.h index ac862a500d..79bf9cfea7 100644 --- a/compiler/tests/generated/type_aliases/complex_types_types.h +++ b/compiler/tests/generated/type_aliases/complex_types_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/type_aliases/custom_alias_with_allocator_types.h b/compiler/tests/generated/type_aliases/custom_alias_with_allocator_types.h index c0d550e0ab..d6fd544468 100644 --- a/compiler/tests/generated/type_aliases/custom_alias_with_allocator_types.h +++ b/compiler/tests/generated/type_aliases/custom_alias_with_allocator_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/type_aliases/custom_alias_without_allocator_types.h b/compiler/tests/generated/type_aliases/custom_alias_without_allocator_types.h index 22281458fd..d620447cb6 100644 --- a/compiler/tests/generated/type_aliases/custom_alias_without_allocator_types.h +++ b/compiler/tests/generated/type_aliases/custom_alias_without_allocator_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/type_aliases/defaults_types.h b/compiler/tests/generated/type_aliases/defaults_types.h index 5715dfb85c..f2e1e32963 100644 --- a/compiler/tests/generated/type_aliases/defaults_types.h +++ b/compiler/tests/generated/type_aliases/defaults_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/type_aliases/empty_types.h b/compiler/tests/generated/type_aliases/empty_types.h index 3adf7a668d..52f521388d 100644 --- a/compiler/tests/generated/type_aliases/empty_types.h +++ b/compiler/tests/generated/type_aliases/empty_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/type_aliases/field_modifiers_types.h b/compiler/tests/generated/type_aliases/field_modifiers_types.h index f5b81fdf3c..537fe2582b 100644 --- a/compiler/tests/generated/type_aliases/field_modifiers_types.h +++ b/compiler/tests/generated/type_aliases/field_modifiers_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/type_aliases/generics_types.h b/compiler/tests/generated/type_aliases/generics_types.h index 5134888015..291f4ad9d8 100644 --- a/compiler/tests/generated/type_aliases/generics_types.h +++ b/compiler/tests/generated/type_aliases/generics_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/type_aliases/import_types.h b/compiler/tests/generated/type_aliases/import_types.h index d9960a1395..04c0c3fb2e 100644 --- a/compiler/tests/generated/type_aliases/import_types.h +++ b/compiler/tests/generated/type_aliases/import_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/type_aliases/inheritance_types.h b/compiler/tests/generated/type_aliases/inheritance_types.h index 06df25369d..1dd4e91559 100644 --- a/compiler/tests/generated/type_aliases/inheritance_types.h +++ b/compiler/tests/generated/type_aliases/inheritance_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/type_aliases/maybe_blob_types.h b/compiler/tests/generated/type_aliases/maybe_blob_types.h index b89dfe5957..18ea380adc 100644 --- a/compiler/tests/generated/type_aliases/maybe_blob_types.h +++ b/compiler/tests/generated/type_aliases/maybe_blob_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/type_aliases/metadata_edge_cases_types.h b/compiler/tests/generated/type_aliases/metadata_edge_cases_types.h index 99ee93c99d..9d6cbd841a 100644 --- a/compiler/tests/generated/type_aliases/metadata_edge_cases_types.h +++ b/compiler/tests/generated/type_aliases/metadata_edge_cases_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/type_aliases/with_enum_header_types.h b/compiler/tests/generated/type_aliases/with_enum_header_types.h index beaf30a2f1..11c29866a9 100644 --- a/compiler/tests/generated/type_aliases/with_enum_header_types.h +++ b/compiler/tests/generated/type_aliases/with_enum_header_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/compiler/tests/generated/with_enum_header_types.h b/compiler/tests/generated/with_enum_header_types.h index bc9ac08073..5f71666bf3 100644 --- a/compiler/tests/generated/with_enum_header_types.h +++ b/compiler/tests/generated/with_enum_header_types.h @@ -3,11 +3,11 @@ #include -#if BOND_VERSION < 0x0902 +#if BOND_VERSION < 0x0b00 #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library. #endif -#if BOND_MIN_CODEGEN_VERSION > 0x0c10 +#if BOND_MIN_CODEGEN_VERSION > 0x0d00 #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library. #endif diff --git a/cpp/inc/bond/core/bond.h b/cpp/inc/bond/core/bond.h index 22d42735fe..06ee188c06 100644 --- a/cpp/inc/bond/core/bond.h +++ b/cpp/inc/bond/core/bond.h @@ -5,6 +5,7 @@ #pragma once #include +#include #include "apply.h" #include "select_protocol.h" @@ -127,4 +128,10 @@ inline void Merge(const T& obj, Reader input, Writer& output) Apply(Merger(obj, output), bonded(input)); } +/// @brief Sets the maximum recursion depth permitted for deserialization operations +inline void SetDeserializeMaxDepth(uint32_t value) +{ + bond::detail::RecursionGuard::SetMaxDepth(value); +} + } diff --git a/cpp/inc/bond/core/bond_version.h b/cpp/inc/bond/core/bond_version.h index 9a3208ad10..af2f161025 100644 --- a/cpp/inc/bond/core/bond_version.h +++ b/cpp/inc/bond/core/bond_version.h @@ -8,8 +8,8 @@ #include #include -#define BOND_VERSION 0x0a00 -#define BOND_MIN_CODEGEN_VERSION 0x0c10 +#define BOND_VERSION 0x0b00 +#define BOND_MIN_CODEGEN_VERSION 0x0d00 namespace bond { diff --git a/cpp/inc/bond/core/detail/recursionguard.h b/cpp/inc/bond/core/detail/recursionguard.h new file mode 100644 index 0000000000..f2a0abb3da --- /dev/null +++ b/cpp/inc/bond/core/detail/recursionguard.h @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#pragma once + +#include +#include +#include + +namespace bond +{ +namespace detail +{ + +template +struct RecursionGuardStaticsHolder +{ + /// @brief Maximum depth allowed for recursion + static uint32_t maxDepth; + + /// @brief Current recursion depth + thread_local static uint32_t currentDepth; +}; + +template +uint32_t RecursionGuardStaticsHolder::maxDepth = 64; + +template +thread_local uint32_t RecursionGuardStaticsHolder::currentDepth; + +/// @brief Tracks recursive depth, incrementing a thread_local on construction and decrementing it on destruction, throwing if depth exceeds max depth +class RecursionGuard : RecursionGuardStaticsHolder +{ +public: + RecursionGuard() + { + uint32_t depth = currentDepth; + if (depth >= maxDepth) + { + bond::ExceededMaxRecursionDepthException(); + } + + currentDepth = depth + 1; + } + + ~RecursionGuard() + { + currentDepth--; + } + + /// @brief Sets the maximum recursion depth permitted + static void SetMaxDepth(uint32_t value) + { + maxDepth = value; + } +}; + +} // namespace detail +} // namespace bond diff --git a/cpp/inc/bond/core/exception.h b/cpp/inc/bond/core/exception.h index 2961bdbe0f..4387c084cf 100644 --- a/cpp/inc/bond/core/exception.h +++ b/cpp/inc/bond/core/exception.h @@ -67,6 +67,17 @@ struct CoreException "Map key type not valid"); } +[[noreturn]] inline void UnknownDataTypeException() +{ + BOND_THROW(CoreException, + "Unknown data type found"); +} + +[[noreturn]] inline void ExceededMaxRecursionDepthException() +{ + BOND_THROW(CoreException, + "Max recursion depth exceeded"); +} namespace detail { diff --git a/cpp/inc/bond/core/parser.h b/cpp/inc/bond/core/parser.h index ce7522e558..90b661b337 100644 --- a/cpp/inc/bond/core/parser.h +++ b/cpp/inc/bond/core/parser.h @@ -8,6 +8,7 @@ #include "detail/inheritance.h" #include "detail/omit_default.h" #include "detail/parser_utils.h" +#include "detail/recursionguard.h" #include "detail/typeid_value.h" #include "merge.h" #include "reflection.h" @@ -199,6 +200,8 @@ class DynamicParser bool Apply(const Transform& transform, const Schema& schema) { + detail::RecursionGuard guard; + detail::StructBegin(_input, _base); bool result = this->Read(schema, transform); detail::StructEnd(_input, _base); diff --git a/cpp/inc/bond/core/value.h b/cpp/inc/bond/core/value.h index 9de79a2b13..52260c388c 100644 --- a/cpp/inc/bond/core/value.h +++ b/cpp/inc/bond/core/value.h @@ -8,6 +8,7 @@ #include "bonded.h" #include "protocol.h" #include "schema.h" +#include "detail/recursionguard.h" #include "detail/typeid_value.h" #include @@ -765,6 +766,8 @@ inline void SkipContainer(const T& element, Reader& input) { BOOST_STATIC_ASSERT(uses_static_parser::value); + bond::detail::RecursionGuard guard; + uint32_t size; { @@ -792,6 +795,8 @@ inline DeserializeContainer(X& var, const T& element, Reader& input) BondDataType type = GetTypeId(element); uint32_t size = 0; + bond::detail::RecursionGuard guard; + input.ReadContainerBegin(size, type); switch (type) @@ -829,6 +834,8 @@ inline DeserializeContainer(X& var, const T& element, Reader& input) BondDataType type = GetTypeId(element); uint32_t size; + bond::detail::RecursionGuard guard; + input.ReadContainerBegin(size, type); if (type == GetTypeId(element)) @@ -851,6 +858,8 @@ inline DeserializeContainer(X& var, const T& element, Reader& input) BondDataType type = GetTypeId(element); uint32_t size; + bond::detail::RecursionGuard guard; + input.ReadContainerBegin(size, type); switch (type) @@ -885,6 +894,8 @@ inline DeserializeContainer(X& var, const T& element, Reader& input) template void DeserializeMap(const Transform& transform, BondDataType keyType, const value& element, SchemaReader& input) { + bond::detail::RecursionGuard guard; + switch (element.GetTypeId()) { case bond::BT_SET: @@ -950,6 +961,8 @@ inline void SkipMap(BondDataType keyType, const T& element, Reader& input) { BOOST_STATIC_ASSERT(uses_static_parser::value); + bond::detail::RecursionGuard guard; + uint32_t size; { @@ -968,6 +981,8 @@ template typename boost::disable_if >::type inline DeserializeMap(X& var, BondDataType keyType, const T& element, Reader& input) { + bond::detail::RecursionGuard guard; + std::pair type(keyType, GetTypeId(element)); uint32_t size = 0; @@ -1005,6 +1020,8 @@ template typename boost::enable_if >::type inline DeserializeMap(X& var, BondDataType keyType, const T& element, Reader& input) { + bond::detail::RecursionGuard guard; + std::pair type(keyType, GetTypeId(element)); uint32_t size; @@ -1027,6 +1044,8 @@ template typename boost::enable_if >::type inline DeserializeMap(X& var, BondDataType keyType, const T& element, Reader& input) { + bond::detail::RecursionGuard guard; + std::pair type(keyType, GetTypeId(element)); uint32_t size; diff --git a/cpp/inc/bond/protocol/compact_binary.h b/cpp/inc/bond/protocol/compact_binary.h index a293a72eec..ad8de71d90 100644 --- a/cpp/inc/bond/protocol/compact_binary.h +++ b/cpp/inc/bond/protocol/compact_binary.h @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -460,6 +461,8 @@ class CompactBinaryReader BondDataType element_type; uint32_t size; + bond::detail::RecursionGuard guard; + ReadContainerBegin(size, element_type); SkipType(element_type, size); ReadContainerEnd(); @@ -472,6 +475,8 @@ class CompactBinaryReader std::pair element_type; uint32_t size; + bond::detail::RecursionGuard guard; + ReadContainerBegin(size, element_type); for (int64_t i = 0; i < size; ++i) { @@ -485,6 +490,8 @@ class CompactBinaryReader { BOOST_ASSERT(v1 == _version); + bond::detail::RecursionGuard guard; + for (;;) { ReadStructBegin(); @@ -612,6 +619,7 @@ class CompactBinaryReader break; default: + bond::UnknownDataTypeException(); break; } } diff --git a/cpp/inc/bond/protocol/fast_binary.h b/cpp/inc/bond/protocol/fast_binary.h index 6d7f59c472..b3f5e061cf 100644 --- a/cpp/inc/bond/protocol/fast_binary.h +++ b/cpp/inc/bond/protocol/fast_binary.h @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -328,6 +329,8 @@ class FastBinaryReader typename boost::enable_if_c<(T == BT_STRUCT)>::type SkipType() { + bond::detail::RecursionGuard guard; + for (;;) { ReadStructBegin(); @@ -356,6 +359,8 @@ class FastBinaryReader BondDataType element_type; uint32_t size; + bond::detail::RecursionGuard guard; + ReadContainerBegin(size, element_type); SkipType(element_type, size); ReadContainerEnd(); @@ -368,6 +373,8 @@ class FastBinaryReader std::pair element_type; uint32_t size; + bond::detail::RecursionGuard guard; + ReadContainerBegin(size, element_type); for (int64_t i = 0; i < size; ++i) { @@ -444,6 +451,7 @@ class FastBinaryReader break; default: + bond::UnknownDataTypeException(); break; } } diff --git a/cpp/test/core/exception_tests.cpp b/cpp/test/core/exception_tests.cpp index 4263c807ad..a6ce23abd5 100644 --- a/cpp/test/core/exception_tests.cpp +++ b/cpp/test/core/exception_tests.cpp @@ -2,14 +2,24 @@ #include "allocator_test_reflection.h" #include "exception_tests.h" + +template +bond::blob BlobFromStringLiteral(const char (&literal)[N]) +{ + // string literals have an extra NUL char at the end that isn't part of + // the payload, so adjust the size. + return bond::blob(literal, static_cast(N - 1)); +} + + template void Deserialize(bond::blob data) -{ +{ BOOST_STATIC_ASSERT((std::is_same::value || std::is_same::value)); Reader reader(data); bond::bonded bonded(reader); - + T obj; // De-serialize the object @@ -27,7 +37,7 @@ struct InvalidPayload // Attempt to de-serialize or skip the field leads to Eof exception. typename Writer::Buffer buffer; Writer writer(buffer); - + writer.WriteStructBegin(bond::Metadata(), false); writer.WriteFieldBegin(bond::get_type_id::value, 2); @@ -63,10 +73,10 @@ struct MissingFieldExceptionTest // unrolling results in Eof exception which is internally caught. // With static parser there is no missing field exception and only Eof exception. typedef BondStructRequired Type; - + bool exception; bond::blob payload; - + payload = InvalidPayload::template PartialField(); // compile-time binding @@ -121,10 +131,10 @@ template TEST_CASE_BEGIN(OomException) { typedef BondStructOptional > > Type; - + bool exception; bond::blob payload; - + payload = InvalidPayload::template OomField >(); // compile-time binding @@ -257,7 +267,7 @@ template TEST_CASE_BEGIN(TransformException) { typename Writer::Buffer buffer(4096); - + Factory::Call(buffer, bond::v1, boost::bind( bond::Serialize, InitRandom(2, 2), boost::placeholders::_1)); @@ -297,22 +307,263 @@ TEST_CASE_BEGIN(TransformException) } TEST_CASE_END - template void ExceptionTests(const char* name) { UnitTestSuite suite(name); - AddTestCase(suite, "Out of memory"); - AddTestCase(suite, "Eof after missing field"); - AddTestCase(suite, "Exceptions in transform"); } +template +void ValidateReaderPayloadException(const bond::blob& payload) +{ + bond::InputBuffer buffer { payload }; + Reader reader(buffer); + try + { + DeserializedType obj; + Deserialize(reader, obj); + UT_AssertIsTrue(false); + } + catch (bond::Exception&) {} +} + +template +void ValidateReaderPayloadException(const bond::blob& payload) +{ + bond::InputBuffer buffer { payload }; + Reader reader(buffer, Protocol); + try + { + DeserializedType obj; + Deserialize(reader, obj); + UT_AssertIsTrue(false); + } + catch (bond::Exception&){} +} + +TEST_CASE_BEGIN(ExceptionTests_CompactBinary_LargeContainerInvalidTypes_TestCase) +{ + const bond::blob payloads[] = + { + BlobFromStringLiteral("\x8b\x1e\xff\xff\xff\xff\x07\xff\xff\xff\xff"), // BT_LIST<0x1e> + BlobFromStringLiteral("\x8b\x8d\xff\xff\xff\xff\x07\xff\xff\xff\xff"), // BT_LIST<0x8d> + BlobFromStringLiteral("\x8c\x1e\xff\xff\xff\xff\x07\xff\xff\xff\xff"), // BT_SET<0x1e> + BlobFromStringLiteral("\x8c\x8d\xff\xff\xff\xff\x07\xff\xff\xff\xff"), // BT_SET<0x8d> + BlobFromStringLiteral("\x8d\x1e\x07\xff\xff\xff\xff\x07\xff\xff\xff\xff"), // BT_MAP<0x1e, BT_FLOAT> + BlobFromStringLiteral("\x8d\x8d\x07\xff\xff\xff\xff\x07\xff\xff\xff\xff"), // BT_MAP<0x8d, BT_FLOAT> + BlobFromStringLiteral("\x8d\x07\x1e\xff\xff\xff\xff\x07\xff\xff\xff\xff"), // BT_MAP + BlobFromStringLiteral("\x8d\x07\x8d\xff\xff\xff\xff\x07\xff\xff\xff\xff"), // BT_MAP + }; + + for (const bond::blob& payload : payloads) + { + ValidateReaderPayloadException, NestedStruct, 1>(payload); + ValidateReaderPayloadException, NestedStruct, 2>(payload); + } +} +TEST_CASE_END + +TEST_CASE_BEGIN(ExceptionTests_FastBinary_LargeContainerInvalidTypes_TestCase) +{ + const bond::blob payloads[] = + { + BlobFromStringLiteral("\x0b\x04\x00\x1e\xff\xff\xff\xff\x07\xff\xff\xff\xff"), // BT_LIST<0x1e> + BlobFromStringLiteral("\x0b\x04\x00\x8d\xff\xff\xff\xff\x07\xff\xff\xff\xff"), // BT_LIST<0x8d> + BlobFromStringLiteral("\x0c\x04\x00\x1e\xff\xff\xff\xff\x07\xff\xff\xff\xff"), // BT_SET<0x1e> + BlobFromStringLiteral("\x0c\x04\x00\x8d\xff\xff\xff\xff\x07\xff\xff\xff\xff"), // BT_SET<0x8d> + BlobFromStringLiteral("\x0d\x04\x00\x1e\x07\xff\xff\xff\xff\x07\xff\xff\xff\xff"), // BT_MAP<0x1e, BT_FLOAT> + BlobFromStringLiteral("\x0d\x04\x00\x8d\x07\xff\xff\xff\xff\x07\xff\xff\xff\xff"), // BT_MAP<0x8d, BT_FLOAT> + BlobFromStringLiteral("\x0d\x04\x00\x07\x1e\xff\xff\xff\xff\x07\xff\xff\xff\xff"), // BT_MAP + BlobFromStringLiteral("\x0d\x04\x00\x07\x8d\xff\xff\xff\xff\x07\xff\xff\xff\xff"), // BT_MAP + }; + + for (const bond::blob& payload : payloads) + { + ValidateReaderPayloadException, NestedStruct>(payload); + } +} +TEST_CASE_END + +TEST_CASE_BEGIN(ExceptionTests_SimpleBinary_RecursionViaNesting) +{ + // Manually-constructed payload with a nesting depth of 200 + const size_t Depth = 200; + std::vector payloadBuffer; + payloadBuffer.reserve(Depth * 8); + for (int i = 0; i < Depth; i++) + { + payloadBuffer.push_back(0xe8); + payloadBuffer.push_back(0x03); + payloadBuffer.push_back(0x00); + payloadBuffer.push_back(0x00); + payloadBuffer.push_back(0x01); + payloadBuffer.push_back(0x00); + payloadBuffer.push_back(0x00); + payloadBuffer.push_back(0x00); + } + + bond::blob payload(payloadBuffer.data(), static_cast(payloadBuffer.size())); + ValidateReaderPayloadException, StructWithRecursiveReference>(payload); +} +TEST_CASE_END + +TEST_CASE_BEGIN(ExceptionTests_CompactBinary_RecursionViaSkip) +{ + // Depth 130, BT_STRUCT, Protocol v1 + ValidateReaderPayloadException, NestedWithBase1, 1>( + BlobFromStringLiteral("\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\xCA\x32\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00")); + + // Depth 130, BT_LIST, Protocol v1 + ValidateReaderPayloadException, NestedWithBase1, 1>( + BlobFromStringLiteral("\xCB\x32\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x64\x00")); + + // Depth 130, BT_LIST, Protocol v2 + ValidateReaderPayloadException, NestedWithBase1, 2>( + BlobFromStringLiteral("\x86\x01\xCB\x32\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x4B\x64\x00")); + + // Depth 130, BT_SET, Protocol v1 + ValidateReaderPayloadException, NestedWithBase1, 1>( + BlobFromStringLiteral("\xCC\x32\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x64\x00")); + + // Depth 130, BT_SET, Protocol v2 + ValidateReaderPayloadException, NestedWithBase1, 2>( + BlobFromStringLiteral("\x86\x01\xCC\x32\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x4C\x64\x00")); + + // Depth 130, BT_MAP, Protocol v1 + ValidateReaderPayloadException, NestedWithBase1, 1>( + BlobFromStringLiteral("\xCD\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x32\x64\x00")); + + // Depth 130, BT_MAP, Protocol v2 + ValidateReaderPayloadException, NestedWithBase1, 2>( + BlobFromStringLiteral("\x8D\x04\xCD\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x32\x64\x00")); +} +TEST_CASE_END + +TEST_CASE_BEGIN(ExceptionTests_FastBinary_RecursionViaSkip) +{ + // Depth 130, BT_STRUCT, Protocol v1 + ValidateReaderPayloadException, NestedWithBase1>( + BlobFromStringLiteral("\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x0A\x32\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00")); + + // Depth 130, BT_LIST, Protocol v1 + ValidateReaderPayloadException, NestedWithBase1>( + BlobFromStringLiteral("\x0B\x32\x00\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x0B\x01\x64\x00")); + + // Depth 130, BT_SET, Protocol v1 + ValidateReaderPayloadException, NestedWithBase1>( + BlobFromStringLiteral("\x0C\x32\x00\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x0C\x01\x64\x00")); + + // Depth 130, BT_MAP, Protocol v1 + ValidateReaderPayloadException, NestedWithBase1>( + BlobFromStringLiteral("\x0D\x32\x00\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x0E\x0D\x01\x32\x32\x64\x00")); +} +TEST_CASE_END + +TEST_CASE_BEGIN(ExceptionTests_SetDeserializeMaxDepth_ImpactsValidWorkloads) +{ + NestedStruct3 from; + InitRandom(from); + + // Default max depth + { + bond::OutputBuffer output; + bond::CompactBinaryWriter writer(output); + Serialize(from, writer); + + bond::CompactBinaryReader reader(output.GetBuffer()); + NestedStruct3 to; + Deserialize(reader, to); + UT_Equal(from, to); + } + + // Lower the depth to the point where a valid workload fails + { + bond::OutputBuffer output; + bond::CompactBinaryWriter writer(output); + Serialize(from, writer); + + bool exception = false; + try + { + bond::SetDeserializeMaxDepth(1); + + bond::CompactBinaryReader reader(output.GetBuffer()); + NestedStruct3 to; + Deserialize(reader, to); + } + catch (bond::CoreException&) + { + exception = true; + } + UT_AssertIsTrue(exception); + } + + // Put the depth back and validate the workload works again + { + bond::OutputBuffer output; + bond::CompactBinaryWriter writer(output); + Serialize(from, writer); + + bond::SetDeserializeMaxDepth(64); + + bond::CompactBinaryReader reader(output.GetBuffer()); + NestedStruct3 to; + Deserialize(reader, to); + UT_Equal(from, to); + } +} +TEST_CASE_END + +template +void ExceptionTests_SimpleBinary_BadPayload(const char* name) +{ + UnitTestSuite suite(name); + + AddTestCase(suite, "Recursion via nesting"); +} + +template +void ExceptionTests_CompactBinary_BadPayload(const char* name) +{ + UnitTestSuite suite(name); + + AddTestCase(suite, "Large container of invalid types"); + + AddTestCase(suite, "Recursion via Skip"); +} + +template +void ExceptionTests_FastBinary_BadPayload(const char* name) +{ + UnitTestSuite suite(name); + + AddTestCase(suite, "Large container of invalid types"); + + AddTestCase(suite, "Recursion via Skip"); +} + +template +void ExceptionTests_SetDeserializeMaxDepth(const char* name) +{ + UnitTestSuite suite(name); + + AddTestCase(suite, "Test that SetDeserializeMaxDepth has an effect"); +} void ExceptionTest::Initialize() { @@ -320,21 +571,41 @@ void ExceptionTest::Initialize() ExceptionTests< 0x1501, bond::SimpleBinaryReader, - bond::SimpleBinaryWriter >("Exception tests for SimpleBinary"); + bond::SimpleBinaryWriter >("Exception tests for SimpleBinary"); ); TEST_COMPACT_BINARY_PROTOCOL( ExceptionTests< 0x1502, bond::CompactBinaryReader, - bond::CompactBinaryWriter >("Exception tests for CompactBinary"); + bond::CompactBinaryWriter >("Exception tests for CompactBinary"); ); TEST_FAST_BINARY_PROTOCOL( ExceptionTests< 0x1503, bond::FastBinaryReader, - bond::FastBinaryWriter >("Exception tests for FastBinary"); + bond::FastBinaryWriter >("Exception tests for FastBinary"); + ); + + TEST_SIMPLE_PROTOCOL( + ExceptionTests_SimpleBinary_BadPayload< + 0x1504 >("Exception tests with bad payloads specific to SimpleBinary"); + ); + + TEST_COMPACT_BINARY_PROTOCOL( + ExceptionTests_CompactBinary_BadPayload< + 0x1505 >("Exception tests with bad payloads specific to CompactBinary"); + ); + + TEST_FAST_BINARY_PROTOCOL( + ExceptionTests_FastBinary_BadPayload< + 0x1506 >("Exception tests with bad payloads specific to FastBinary"); + ); + + TEST_COMPACT_BINARY_PROTOCOL( + ExceptionTests_SetDeserializeMaxDepth< + 0x1507 >("Exception tests validating the behavior of SetDeserializeMaxDepth"); ); } @@ -344,4 +615,3 @@ bool init_unit_test() ExceptionTest::Initialize(); return true; } - diff --git a/cpp/test/core/unit_test_core.bond b/cpp/test/core/unit_test_core.bond index 4de4287a1f..b50843eb5a 100644 --- a/cpp/test/core/unit_test_core.bond +++ b/cpp/test/core/unit_test_core.bond @@ -218,3 +218,9 @@ struct NestedListsStruct 10: required_optional map> m64ls; 11: required_optional vector> vmds; }; + +struct StructWithRecursiveReference +{ + 0: uint32 Value; + 1: nullable Child; +} diff --git a/cs/build/internal/Common.Internal.props b/cs/build/internal/Common.Internal.props index 03f8002022..ffe9b148b1 100644 --- a/cs/build/internal/Common.Internal.props +++ b/cs/build/internal/Common.Internal.props @@ -10,10 +10,10 @@ - net45 + net462 - v4.5 + v4.6.2 bin\$(BuildType)\$(BuildFramework) diff --git a/cs/build/internal/Common.Internal.targets b/cs/build/internal/Common.Internal.targets index e56a2a1d40..aa3e2a6620 100644 --- a/cs/build/internal/Common.Internal.targets +++ b/cs/build/internal/Common.Internal.targets @@ -16,7 +16,7 @@ - + diff --git a/cs/nuget/.dir-locals.el b/cs/nuget/.dir-locals.el index 87e7ba64ee..21003e0bed 100644 --- a/cs/nuget/.dir-locals.el +++ b/cs/nuget/.dir-locals.el @@ -1,8 +1,12 @@ ;;; Directory Local Variables ;;; For more information see (info "(emacs) Directory Variables") -; In the .nuspec files we want line sorting for things like to -; be CASE SENSITIVE, otherwise Bond.dll and Bond.xml get sorted really far -; away from each other. -((nil - (sort-fold-case))) +( + ; In the .nuspec files we want line sorting for things like to + ; be CASE SENSITIVE, otherwise Bond.dll and Bond.xml get sorted really far + ; away from each other. + (nil . ((sort-fold-case . nil))) + ; The nuspec files in this directory are indented with four spaces per + ; level, instead of the typical two for XML-things in the .NET world (like + ; .csproj files). + (nxml-mode . ((nxml-child-indent . 4)))) diff --git a/cs/nuget/bond.compiler.csharp.nuspec b/cs/nuget/bond.compiler.csharp.nuspec index 7efa798ac3..d91e95cbb5 100644 --- a/cs/nuget/bond.compiler.csharp.nuspec +++ b/cs/nuget/bond.compiler.csharp.nuspec @@ -21,35 +21,49 @@ © Microsoft Corporation. All rights reserved. Bond .NET C# serialization + + + + + + - - - - - + + + + + + + + + + + + + diff --git a/cs/nuget/bond.core.csharp.nuspec b/cs/nuget/bond.core.csharp.nuspec index 3f5324f3e7..50157172e5 100644 --- a/cs/nuget/bond.core.csharp.nuspec +++ b/cs/nuget/bond.core.csharp.nuspec @@ -23,35 +23,28 @@ © Microsoft Corporation. All rights reserved. Bond .NET C# serialization + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/cs/nuget/bond.csharp.test.csproj b/cs/nuget/bond.csharp.test.csproj index 29faf5329e..f04b8875a0 100644 --- a/cs/nuget/bond.csharp.test.csproj +++ b/cs/nuget/bond.csharp.test.csproj @@ -4,7 +4,7 @@ Library Test Bond.NuGetTest - net46 + net462 true ..\build\internal\bond.snk false @@ -23,7 +23,10 @@ - + + @@ -40,7 +43,7 @@ $(BondOptions) --using="DateTime=System.DateTime" - + $(BondOptions) --using="ImmutableArray=System.Collections.Immutable.ImmutableArray<{0}>" --using="ImmutableList=System.Collections.Immutable.ImmutableList<{0}>" --using="ImmutableHashSet=System.Collections.Immutable.ImmutableHashSet<{0}>" --using="ImmutableSortedSet=System.Collections.Immutable.ImmutableSortedSet<{0}>" --using="ImmutableDictionary=System.Collections.Immutable.ImmutableDictionary<{0},{1}>" --using="ImmutableSortedDictionary=System.Collections.Immutable.ImmutableSortedDictionary<{0},{1}>" diff --git a/cs/nuget/bond.runtime.csharp.nuspec b/cs/nuget/bond.runtime.csharp.nuspec index 6652cd8d76..56f4c3e6e0 100644 --- a/cs/nuget/bond.runtime.csharp.nuspec +++ b/cs/nuget/bond.runtime.csharp.nuspec @@ -24,16 +24,30 @@ © Microsoft Corporation. All rights reserved. Bond .NET C# serialization - - + + + + + + + + + + + + + + + + - - - + + + diff --git a/cs/nuget/empty b/cs/nuget/empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/cs/src/attributes/Attributes.csproj b/cs/src/attributes/Attributes.csproj index 585bc06e8a..4d958788ac 100644 --- a/cs/src/attributes/Attributes.csproj +++ b/cs/src/attributes/Attributes.csproj @@ -3,7 +3,7 @@ {92915BD9-8AB1-4E4D-A2AC-95BBF4F82D89} - net45;netstandard1.0;netstandard1.6 + net462;netstandard1.0;netstandard1.6 Debug;Release Bond Bond.Attributes diff --git a/cs/src/core/Bond.csproj b/cs/src/core/Bond.csproj index d63ae6e856..bf40b6609a 100644 --- a/cs/src/core/Bond.csproj +++ b/cs/src/core/Bond.csproj @@ -3,12 +3,12 @@ {43CBBA9B-C4BC-4E64-8733-7B72562D2E91} - net45;netstandard1.0;netstandard1.6 + net462;netstandard1.0;netstandard1.6 Debug;Release true - + $(DefineConstants);SUPPORTS_XMLRESOLVER diff --git a/cs/src/core/expressions/DeserializerTransform.cs b/cs/src/core/expressions/DeserializerTransform.cs index 371f0b4694..b89e1dfbbd 100644 --- a/cs/src/core/expressions/DeserializerTransform.cs +++ b/cs/src/core/expressions/DeserializerTransform.cs @@ -4,11 +4,17 @@ namespace Bond { using System; + using System.Diagnostics; + using System.IO; + using System.Linq.Expressions; + using System.Reflection; + using System.Runtime.CompilerServices; public struct DeserializerControls { int maxPreallocatedContainerElements; int maxPreallocatedBlobBytes; + int maxDepth; // Default settings public readonly static DeserializerControls Default; @@ -20,6 +26,7 @@ static DeserializerControls() { Default.MaxPreallocatedContainerElements = 64 * 1024; Default.MaxPreallocatedBlobBytes = 64 * 1024 * 1024; + Default.MaxDepth = 64; Active = Default; } @@ -48,6 +55,106 @@ public int MaxPreallocatedBlobBytes maxPreallocatedBlobBytes = value; } } + + public int MaxDepth + { + get { return maxDepth; } + set + { + if (value <= 0) + { + throw new ArgumentOutOfRangeException("value", "Value must be positive"); + } + maxDepth = value; + } + } + } + + /// + /// Provides utility methods for tracking recursion depth and throwing an exception when the + /// tracked depth has exceeded DeserializerControls.Active.MaxDepth. + /// + internal static class MaxDepthChecker + { + /// The depth tracked for the current thread. + /// + /// This needn't correspond 1:1 with schema structure. It is an approximate representation of how deeply deserialization + /// has recurred, in order to provide a defense-in-depth measure against stack overflows. + /// + [ThreadStatic] + static int t_depth; + + /// A cached Expression for MaxDepthChecker.t_depth. + static readonly Expression s_depthThreadStaticField = Expression.Field(null, typeof(MaxDepthChecker), nameof(t_depth)); + + /// A cached Expression for DeserializerControls.Active.MaxDepth. + static readonly Expression s_maxDepthProperty = Expression.Property(Expression.Field(null, typeof(DeserializerControls), nameof(DeserializerControls.Active)), nameof(DeserializerControls.MaxDepth)); + + /// Cached MethodInfo for the method. + static readonly MethodInfo s_validateDepthForIncrement = typeof(MaxDepthChecker).GetTypeInfo().GetDeclaredMethod(nameof(ValidateDepthForIncrement)); + + /// Cached MethodInfo for the method. + static readonly MethodInfo s_setDepth = typeof(MaxDepthChecker).GetTypeInfo().GetDeclaredMethod(nameof(SetDepth)); + + /// Wraps the supplied expression in a depth check. + public static Expression WithDepthCheck(Expression expression) + { + // The pattern employed here is designed to handle asynchronous exceptions like thread aborts, + // such that no matter where a thread abort occurs (assuming non-rude thread aborts that are delayed + // over finally blocks), the depth will always be left on exit as it was on entrance. + // + // int depth = ValidateDepthForIncrement(); + // try + // { + // MaxDepthChecker.SetDepth(depth + 1); + // expression; + // } + // finally + // { + // MaxDepthChecker.SetDepth(depth); + // } + + ParameterExpression depth = Expression.Variable(typeof(int), "depth"); + + return Expression.Block( + new[] { depth }, + Expression.Assign(depth, Expression.Call(s_validateDepthForIncrement)), + Expression.TryFinally( + Expression.Block( + Expression.Call(s_setDepth, Expression.Increment(depth)), + expression), + Expression.Call(s_setDepth, depth))); + } + + /// Validates the current depth against the limit, assuming it's about to be incremented, and returns it. + /// Recursion depth exceeded DeserializerControls.MaxDepth. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int ValidateDepthForIncrement() + { + int depth = t_depth; + Debug.Assert(depth >= 0); + + // Check with >= rather than > as we're validating depth+1. + if (depth >= DeserializerControls.Active.MaxDepth) + { + ThrowTooDeepException(); + } + + return depth; + } + + /// Sets the tracked depth. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void SetDepth(int depth) + { + Debug.Assert(depth >= 0 && depth <= DeserializerControls.Active.MaxDepth); + t_depth = depth; + } + + /// Undoes an increment to the current depth and throws an exception indicating max depth exceeded. + [MethodImpl(MethodImplOptions.NoInlining)] + private static void ThrowTooDeepException() => + throw new InvalidDataException($"Recursion depth exceeded {nameof(DeserializerControls)}.{nameof(DeserializerControls.MaxDepth)}"); } } diff --git a/cs/src/core/expressions/TaggedParser.cs b/cs/src/core/expressions/TaggedParser.cs index c7b37c64c5..1f7026ef1b 100644 --- a/cs/src/core/expressions/TaggedParser.cs +++ b/cs/src/core/expressions/TaggedParser.cs @@ -125,9 +125,10 @@ from f in transform.Fields select body.Add(isBase ? reader.ReadBaseEnd() : reader.ReadStructEnd()); body.Add(transform.End); - return Expression.Block( - new[] { fieldType, fieldId }, - body); + return MaxDepthChecker.WithDepthCheck( + Expression.Block( + new[] { fieldType, fieldId }, + body)); } public Expression Container(BondDataType? expectedType, ContainerHandler handler) @@ -141,11 +142,12 @@ public Expression Container(BondDataType? expectedType, ContainerHandler handler expectedType, type => handler(this, type, next, count, null)); - return Expression.Block( - new[] { count, elementType }, - reader.ReadContainerBegin(count, elementType), - loops, - reader.ReadContainerEnd()); + return MaxDepthChecker.WithDepthCheck( + Expression.Block( + new[] { count, elementType }, + reader.ReadContainerBegin(count, elementType), + loops, + reader.ReadContainerEnd())); } public Expression Map(BondDataType? expectedKeyType, BondDataType? expectedValueType, MapHandler handler) @@ -159,11 +161,12 @@ public Expression Map(BondDataType? expectedKeyType, BondDataType? expectedValue MatchOrCompatible(valueType, expectedValueType, constantValueType => handler(this, this, constantKeyType, constantValueType, next, Expression.Empty(), count))); - return Expression.Block( - new[] { count, keyType, valueType }, - reader.ReadContainerBegin(count, keyType, valueType), - loops, - reader.ReadContainerEnd()); + return MaxDepthChecker.WithDepthCheck( + Expression.Block( + new[] { count, keyType, valueType }, + reader.ReadContainerBegin(count, keyType, valueType), + loops, + reader.ReadContainerEnd())); } public Expression Blob(Expression count) @@ -181,9 +184,10 @@ public Expression Bonded(ValueHandler handler) { var newBonded = bondedFactory(reader.Param, Expression.Constant(RuntimeSchema.Empty)); - return Expression.Block( - handler(newBonded), - reader.Skip(Expression.Constant(BondDataType.BT_STRUCT))); + return MaxDepthChecker.WithDepthCheck( + Expression.Block( + handler(newBonded), + reader.Skip(Expression.Constant(BondDataType.BT_STRUCT)))); } public Expression Skip(Expression type) diff --git a/cs/src/core/expressions/UntaggedParser.cs b/cs/src/core/expressions/UntaggedParser.cs index 1a8d9b5297..8ab0614b13 100644 --- a/cs/src/core/expressions/UntaggedParser.cs +++ b/cs/src/core/expressions/UntaggedParser.cs @@ -89,7 +89,8 @@ from knownField in fields.DefaultIfEmpty() select Field(transform, fieldDef, knownField)); body.Add(transform.End); - return Expression.Block(body); + return MaxDepthChecker.WithDepthCheck( + Expression.Block(body)); } Expression Field(ITransform transform, FieldDef fieldDef, IField field) @@ -99,10 +100,10 @@ Expression Field(ITransform transform, FieldDef fieldDef, IField field) var fieldParser = new UntaggedParser(this, schema.GetFieldSchema(fieldDef)); return Expression.IfThenElse(reader.ReadFieldOmitted(), - field != null ? field.Omitted : Expression.Empty(), - field != null ? - field.Value(fieldParser, fieldType) : - transform.UnknownField(fieldParser, fieldType, fieldId) ?? fieldParser.Skip(fieldType)); + field != null ? field.Omitted : Expression.Empty(), + field != null ? + field.Value(fieldParser, fieldType) : + MaxDepthChecker.WithDepthCheck(transform.UnknownField(fieldParser, fieldType, fieldId) ?? fieldParser.Skip(fieldType))); } public Expression Container(BondDataType? expectedType, ContainerHandler handler) @@ -118,11 +119,12 @@ public Expression Container(BondDataType? expectedType, ContainerHandler handler count, null); - return Expression.Block( - new[] { count }, - Expression.Assign(count, reader.ReadContainerBegin()), - loop, - reader.ReadContainerEnd()); + return MaxDepthChecker.WithDepthCheck( + Expression.Block( + new[] { count }, + Expression.Assign(count, reader.ReadContainerBegin()), + loop, + reader.ReadContainerEnd())); } public Expression Map(BondDataType? expectedKeyType, BondDataType? expectedValueType, MapHandler handler) @@ -140,11 +142,12 @@ public Expression Map(BondDataType? expectedKeyType, BondDataType? expectedValue Expression.Empty(), count); - return Expression.Block( - new[] { count }, - Expression.Assign(count, reader.ReadContainerBegin()), - loop, - reader.ReadContainerEnd()); + return MaxDepthChecker.WithDepthCheck( + Expression.Block( + new[] { count }, + Expression.Assign(count, reader.ReadContainerBegin()), + loop, + reader.ReadContainerEnd())); } public Expression Blob(Expression count) @@ -161,16 +164,12 @@ public Expression Scalar(Expression valueType, BondDataType expectedType, ValueH public Expression Bonded(ValueHandler handler) { - if (schema.IsBonded) - { - return handler(reader.ReadMarshaledBonded()); - } - - var newBonded = bondedFactory(reader.Param, Expression.Constant(schema)); - - return Expression.Block( - handler(newBonded), - SkipStruct()); + return MaxDepthChecker.WithDepthCheck( + schema.IsBonded ? + handler(reader.ReadMarshaledBonded()) : + Expression.Block( + handler(bondedFactory(reader.Param, Expression.Constant(schema))), + SkipStruct())); } public Expression Skip(Expression valueType) @@ -260,7 +259,7 @@ Expression SkipStruct() Expression SkipStruct(Expression> skip) { - return Expression.Invoke(skip, reader.Param); + return MaxDepthChecker.WithDepthCheck(Expression.Invoke(skip, reader.Param)); } public override bool Equals(object that) diff --git a/cs/src/core/protocols/CompactBinary.cs b/cs/src/core/protocols/CompactBinary.cs index 1111bb5c58..481c085bbd 100644 --- a/cs/src/core/protocols/CompactBinary.cs +++ b/cs/src/core/protocols/CompactBinary.cs @@ -881,24 +881,44 @@ void SkipContainer() } else { - while (0 <= --count) + int depth = MaxDepthChecker.ValidateDepthForIncrement(); + try + { + MaxDepthChecker.SetDepth(depth + 1); + + while (0 <= --count) + { + Skip(elementType); + } + } + finally { - Skip(elementType); + MaxDepthChecker.SetDepth(depth); } } } void SkipMap() { - BondDataType keyType; - BondDataType valueType; - int count; + int depth = MaxDepthChecker.ValidateDepthForIncrement(); + try + { + MaxDepthChecker.SetDepth(depth + 1); + + BondDataType keyType; + BondDataType valueType; + int count; - ReadContainerBegin(out count, out keyType, out valueType); - while (0 <= --count) + ReadContainerBegin(out count, out keyType, out valueType); + while (0 <= --count) + { + Skip(keyType); + Skip(valueType); + } + } + finally { - Skip(keyType); - Skip(valueType); + MaxDepthChecker.SetDepth(depth); } } @@ -910,17 +930,27 @@ void SkipStruct() } else { - while (true) + int depth = MaxDepthChecker.ValidateDepthForIncrement(); + try { - BondDataType type; - ushort id; + MaxDepthChecker.SetDepth(depth + 1); - ReadFieldBegin(out type, out id); + while (true) + { + BondDataType type; + ushort id; - if (type == BondDataType.BT_STOP_BASE) continue; - if (type == BondDataType.BT_STOP) break; + ReadFieldBegin(out type, out id); - Skip(type); + if (type == BondDataType.BT_STOP_BASE) continue; + if (type == BondDataType.BT_STOP) break; + + Skip(type); + } + } + finally + { + MaxDepthChecker.SetDepth(depth); } } } diff --git a/cs/src/core/protocols/FastBinary.cs b/cs/src/core/protocols/FastBinary.cs index 3904a4262c..3c0103f65d 100644 --- a/cs/src/core/protocols/FastBinary.cs +++ b/cs/src/core/protocols/FastBinary.cs @@ -742,9 +742,19 @@ void SkipContainer() input.SkipBytes(checked(count * sizeof(double))); break; default: - while (0 <= --count) + int depth = MaxDepthChecker.ValidateDepthForIncrement(); + try { - Skip(elementType); + MaxDepthChecker.SetDepth(depth + 1); + + while (0 <= --count) + { + Skip(elementType); + } + } + finally + { + MaxDepthChecker.SetDepth(depth); } break; } @@ -752,31 +762,51 @@ void SkipContainer() void SkipMap() { - BondDataType keyType; - BondDataType valueType; - int count; - - ReadContainerBegin(out count, out keyType, out valueType); - while (0 <= --count) + int depth = MaxDepthChecker.ValidateDepthForIncrement(); + try { - Skip(keyType); - Skip(valueType); + MaxDepthChecker.SetDepth(depth + 1); + + BondDataType keyType; + BondDataType valueType; + int count; + + ReadContainerBegin(out count, out keyType, out valueType); + while (0 <= --count) + { + Skip(keyType); + Skip(valueType); + } + } + finally + { + MaxDepthChecker.SetDepth(depth); } } void SkipStruct() { - while (true) + int depth = MaxDepthChecker.ValidateDepthForIncrement(); + try { - BondDataType type; - ushort id; + MaxDepthChecker.SetDepth(depth + 1); + + while (true) + { + BondDataType type; + ushort id; - ReadFieldBegin(out type, out id); + ReadFieldBegin(out type, out id); - if (type == BondDataType.BT_STOP_BASE) continue; - if (type == BondDataType.BT_STOP) break; + if (type == BondDataType.BT_STOP_BASE) continue; + if (type == BondDataType.BT_STOP) break; - Skip(type); + Skip(type); + } + } + finally + { + MaxDepthChecker.SetDepth(depth); } } #endregion diff --git a/cs/src/io/IO.csproj b/cs/src/io/IO.csproj index b17587bd42..b9da2d0c1d 100644 --- a/cs/src/io/IO.csproj +++ b/cs/src/io/IO.csproj @@ -3,7 +3,7 @@ {2E6E238C-9017-445C-9611-66DA780609BE} - net45;net46;netstandard1.3;netstandard1.6 + net462;netstandard1.3;netstandard1.6 Debug;Release Bond.IO Bond.IO diff --git a/cs/src/io/unsafe/StreamCloning.cs b/cs/src/io/unsafe/StreamCloning.cs index 88d6df0f75..4dcdc90bb8 100644 --- a/cs/src/io/unsafe/StreamCloning.cs +++ b/cs/src/io/unsafe/StreamCloning.cs @@ -40,12 +40,12 @@ public static Stream Clone(this Stream stream) throw new NotSupportedException("Stream type " + stream.GetType().FullName + " can't be cloned."); } - + static MemoryStream Clone(MemoryStream stream) { return MemoryStreamCloner.CloneMemoryStream(stream); } - + static FileStream Clone(FileStream stream) { var error = 0; @@ -67,7 +67,7 @@ static FileStream Clone(FileStream stream) throw new Win32Exception(error); } - + static class NativeMethods { public const int NO_ERROR = 0; @@ -83,7 +83,7 @@ static class NativeMethods static class MemoryStreamCloner { -#if !(NET46 || NETSTANDARD1_3 || NETSTANDARD1_6) +#if !(NET462 || NETSTANDARD1_3 || NETSTANDARD1_6) delegate void GetOriginAndLength(MemoryStream stream, out int origin, out int length); static readonly GetOriginAndLength getOriginAndLength; @@ -125,7 +125,7 @@ internal static MemoryStream CloneMemoryStream(MemoryStream stream) getOriginAndLength(stream, out origin, out length); return new MemoryStream(stream.GetBuffer(), origin, length - origin, false, true) { Position = stream.Position }; } -#else // NET46 & NETSTANDARD implementation +#else // NET462 & NETSTANDARD implementation internal static MemoryStream CloneMemoryStream(MemoryStream stream) { ArraySegment buffer; diff --git a/cs/src/json/JSON.csproj b/cs/src/json/JSON.csproj index 7f651b08d8..09325e2bb0 100644 --- a/cs/src/json/JSON.csproj +++ b/cs/src/json/JSON.csproj @@ -3,19 +3,19 @@ {C001C79F-D289-4CF3-BB59-5F5A72F70D0E} - net45;netstandard1.0;netstandard1.6 + net462;netstandard1.0;netstandard1.6 Debug;Release Bond Bond.JSON true - + $(DefineConstants);SUPPORTS_BIGINTEGER - + diff --git a/cs/src/reflection/reflection.csproj b/cs/src/reflection/reflection.csproj index 2f9e3b5086..217ad9bd80 100644 --- a/cs/src/reflection/reflection.csproj +++ b/cs/src/reflection/reflection.csproj @@ -3,7 +3,7 @@ {40452223-3a34-4841-9a69-e0b6640b4108} - net45;netstandard1.0;netstandard1.6 + net462;netstandard1.0;netstandard1.6 Debug;Release Bond.Reflection Bond.Reflection diff --git a/cs/test/codegen/no-warnings/no-warnings.csproj b/cs/test/codegen/no-warnings/no-warnings.csproj index 6a81eeafae..249ca848bd 100644 --- a/cs/test/codegen/no-warnings/no-warnings.csproj +++ b/cs/test/codegen/no-warnings/no-warnings.csproj @@ -1,7 +1,7 @@ - + - net45 + net462 diff --git a/cs/test/codegen/output-no-slash/output-no-slash.csproj b/cs/test/codegen/output-no-slash/output-no-slash.csproj index a97693b180..487ca00f95 100644 --- a/cs/test/codegen/output-no-slash/output-no-slash.csproj +++ b/cs/test/codegen/output-no-slash/output-no-slash.csproj @@ -1,7 +1,7 @@ - net45 + net462 diff --git a/cs/test/core/Core.csproj b/cs/test/core/Core.csproj index b4c5e33bd9..c97c70969a 100644 --- a/cs/test/core/Core.csproj +++ b/cs/test/core/Core.csproj @@ -2,7 +2,7 @@ {FF056B62-225A-47BC-B177-550FADDA4B41} - net45 + net462 Debug;Release;Fields Library Properties @@ -11,7 +11,7 @@ False UnitTest - + $(DefineConstants);SUPPORTS_BIGINTEGER;SUPPORTS_XMLRESOLVER @@ -56,7 +56,7 @@ - + diff --git a/cs/test/core/DeserializerControlsTests.cs b/cs/test/core/DeserializerControlsTests.cs index 3fce6b0ca2..f52e98a650 100644 --- a/cs/test/core/DeserializerControlsTests.cs +++ b/cs/test/core/DeserializerControlsTests.cs @@ -1,7 +1,9 @@ namespace UnitTest { using System; + using System.Collections.Generic; using System.IO; + using System.Linq; using System.Text; using System.Xml; using Bond; @@ -21,6 +23,60 @@ public class DeserializerControlsTests // Data for a simple valid blob static readonly byte[] blobData = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 }; + // Compact Binary payloads with container types that have invalid elements + // and very large sizes. + // + // In all these payloads: + // * field id is 4 + // * invalid element type is 0x8d (masked with 0x1f is BT_MAP) or 0x1e (which is alway invalid) + // * container length is int.MaxValue + static readonly byte[][] containersInvalidElementTypeLargeSize_CompactBinary = new byte[][] + { + // BT_LIST<0x1e> + new byte[] { 0x8b, 0x1e, 0xff, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff }, + // BT_SET<0x1e> + new byte[] { 0x8c, 0x1e, 0xff, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff }, + // BT_MAP<0x1e, BT_FLOAT> + new byte[] { 0x8d, 0x1e, 0x07, 0xff, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff }, + // BT_MAP + new byte[] { 0x8d, 0x07, 0x1e, 0xff, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff }, + // BT_LIST<0x8d> + new byte[] { 0x8b, 0x8d, 0xff, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff }, + // BT_SET<0x8d> + new byte[] { 0x8c, 0x8d, 0xff, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff }, + // BT_MAP<0x8d, BT_FLOAT> + new byte[] { 0x8d, 0x8d, 0x07, 0xff, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff }, + // BT_MAP + new byte[] { 0x8d, 0x07, 0x8d, 0xff, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff }, + }; + + // Fast Binary payloads with container types that have invalid elements + // and very large sizes. + // + // In all these payloads: + // * field id is 4 + // * invalid element type is 0x8d (masked with 0x1f is BT_MAP) or 0x1e (which is alway invalid) + // * container length is int.MaxValue + static readonly byte[][] containersInvalidElementTypeLargeSize_FastBinary = new byte[][] + { + // BT_LIST<0x1e> + new byte[] { 0x0b, 0x04, 0x00, 0x1e, 0xff, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff }, + // BT_SET<0x1e> + new byte[] { 0x0c, 0x04, 0x00, 0x1e, 0xff, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff }, + // BT_MAP<0x1e, BT_FLOAT> + new byte[] { 0x0d, 0x04, 0x00, 0x1e, 0x07, 0xff, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff }, + // BT_MAP + new byte[] { 0x0d, 0x04, 0x00, 0x07, 0x1e, 0xff, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff }, + // BT_LIST<0x8d> + new byte[] { 0x0b, 0x04, 0x00, 0x8d, 0xff, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff }, + // BT_SET<0x8d> + new byte[] { 0x0c, 0x04, 0x00, 0x8d, 0xff, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff }, + // BT_MAP<0x8d, BT_FLOAT> + new byte[] { 0x0d, 0x04, 0x00, 0x8d, 0x07, 0xff, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff }, + // BT_MAP + new byte[] { 0x0d, 0x04, 0x00, 0x07, 0x8d, 0xff, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff }, + }; + // Restore the default settings at the start and end of each test [SetUp] [TearDown] @@ -194,6 +250,22 @@ public void DeserializerControls_InvalidArguments() { Assert.Throws(() => DeserializerControls.Active.MaxPreallocatedContainerElements = -1); Assert.Throws(() => DeserializerControls.Active.MaxPreallocatedBlobBytes = -1); + + const int ExpectedDefaultMaxDepth = 64; + + Assert.AreEqual(ExpectedDefaultMaxDepth, DeserializerControls.Active.MaxDepth); + + Assert.Throws(() => DeserializerControls.Active.MaxDepth = 0); + Assert.AreEqual(ExpectedDefaultMaxDepth, DeserializerControls.Active.MaxDepth); + + Assert.Throws(() => DeserializerControls.Active.MaxDepth = -1); + Assert.AreEqual(ExpectedDefaultMaxDepth, DeserializerControls.Active.MaxDepth); + + DeserializerControls.Active.MaxDepth = 256; + Assert.AreEqual(256, DeserializerControls.Active.MaxDepth); + + DeserializerControls.Active.MaxDepth = DeserializerControls.Default.MaxDepth; + Assert.AreEqual(ExpectedDefaultMaxDepth, DeserializerControls.Active.MaxDepth); } [Test] @@ -221,13 +293,140 @@ public void DeserializerControls_ValidData() DeserializerControls.Active.MaxPreallocatedContainerElements = 80; DeserializerControls.Active.MaxPreallocatedBlobBytes = 80; RoundtripTests(); + DeserializerControls.Active.MaxPreallocatedContainerElements = 20; DeserializerControls.Active.MaxPreallocatedBlobBytes = 20; RoundtripTests(); + DeserializerControls.Active.MaxPreallocatedContainerElements = 0; DeserializerControls.Active.MaxPreallocatedBlobBytes = 0; RoundtripTests(); + + DeserializerControls.Active.MaxDepth = 1; + Assert.Throws(() => RoundtripTests()); + + DeserializerControls.Active.MaxDepth = 2; + Assert.Throws(() => RoundtripTests()); + + DeserializerControls.Active.MaxDepth = 10; + RoundtripTests(); + + DeserializerControls.Active.MaxDepth = 128; + RoundtripTests(); } + [TestCase(100, (ushort)1)] + [TestCase(100_000, (ushort)1)] + [TestCase(100, (ushort)2)] + [TestCase(100_000, (ushort)2)] + public void BadPayload_RecursionViaNesting_SimpleBinary_Throws(int depth, ushort protocolVersion) + { + ArraySegment payload = NestedPayloadFactory.MakeWithRecursiveChild(ProtocolType.SIMPLE_PROTOCOL, protocolVersion, depth); + DeserializeBadPayload(input => new SimpleBinaryReader(input, protocolVersion), typeof(StructWithRecursiveReference), payload, typeof(InvalidDataException)); + } + + [TestCase(100, (ushort)1)] + [TestCase(100_000, (ushort)1)] + [TestCase(100, (ushort)2)] + [TestCase(100_000, (ushort)2)] + public void BadPayload_RecursionViaNesting_CompactBinary_Throws(int depth, ushort protocolVersion) + { + ArraySegment payload = NestedPayloadFactory.MakeWithRecursiveChild(ProtocolType.COMPACT_PROTOCOL, protocolVersion, depth); + DeserializeBadPayload(input => new CompactBinaryReader(input, protocolVersion), typeof(StructWithRecursiveReference), payload, typeof(InvalidDataException)); + } + + [TestCase(100, (ushort)1)] + [TestCase(100_000, (ushort)1)] + [TestCase(100, (ushort)2)] + [TestCase(100_000, (ushort)2)] + public void BadPayload_RecursionViaNesting_FastBinary_Throws(int depth, ushort protocolVersion) + { + ArraySegment payload = NestedPayloadFactory.MakeWithRecursiveChild(ProtocolType.FAST_PROTOCOL, protocolVersion, depth); + DeserializeBadPayload(input => new FastBinaryReader(input, protocolVersion), typeof(StructWithRecursiveReference), payload, typeof(InvalidDataException)); + } + + [TestCaseSource(nameof(DeeplyNestedPayloadTestCases), new object[] { ProtocolType.COMPACT_PROTOCOL })] + public void BadPayload_RecursionViaSkip_CompactBinary_Throws(int depth, BondDataType fieldType, ushort protocolVersion) + { + ArraySegment payload = NestedPayloadFactory.MakeWithUnknownField(ProtocolType.COMPACT_PROTOCOL, protocolVersion, depth, fieldType); + DeserializeBadPayload(input => new CompactBinaryReader(input, protocolVersion), typeof(ClassWithStructProperties), payload, typeof(InvalidDataException)); + } + + [TestCaseSource(nameof(DeeplyNestedPayloadTestCases), new object[] { ProtocolType.FAST_PROTOCOL })] + public void BadPayload_RecursionViaSkip_FastBinary_Throws(int depth, BondDataType fieldType, ushort protocolVersion) + { + ArraySegment payload = NestedPayloadFactory.MakeWithUnknownField(ProtocolType.FAST_PROTOCOL, protocolVersion, depth, fieldType); + DeserializeBadPayload(input => new FastBinaryReader(input, protocolVersion), typeof(ClassWithStructProperties), payload, typeof(InvalidDataException)); + } + + [TestCaseSource(nameof(containersInvalidElementTypeLargeSize_CompactBinary))] + public void BadPayload_InvalidContainerTypeLargeSize_CompactBinary_Throws(byte[] payload) + { + // CompactBinary.ReadContainerBegin masks the data type with 0x1f for sequence + // containers, so some invalid data types map to valid data types. For these, + // EndOfStreamException is expected, as the skipping code will try to read a + // payload that does not exist. + // + // For maps, ReadContainerBegin does not mask. The skip code will always throw + // InvalidDataException. + DeserializeBadPayload( + input => new CompactBinaryReader(input), + typeof(ClassWithStructProperties), + payload, + typeof(EndOfStreamException), + typeof(InvalidDataException)); + } + + [TestCaseSource(nameof(containersInvalidElementTypeLargeSize_FastBinary))] + public void BadPayload_InvalidContainerTypeLargeSize_FastBinary_Throws(byte[] payload) + { + // Fast Binary fails to skip the invalid container element, hence InvalidDataException. + DeserializeBadPayload(input => new FastBinaryReader(input), typeof(ClassWithStructProperties), payload, typeof(InvalidDataException)); + } + + private void DeserializeBadPayload(Func readerFactory, Type deserializedType, byte[] payload, params Type[] expectedExceptionTypes) + { + DeserializeBadPayload(readerFactory, deserializedType, new ArraySegment(payload), expectedExceptionTypes); + } + + private void DeserializeBadPayload(Func readerFactory, Type deserializedType, ArraySegment payload, params Type[] expectedExceptionTypes) + { + var input = new InputBuffer(payload); + TReader reader = readerFactory(input); + var deserializer = new Deserializer(deserializedType); + + var actualException = Assert.Catch(() => deserializer.Deserialize(reader)); + Assert.True( + expectedExceptionTypes.Any(expectedExceptionType => expectedExceptionType.IsInstanceOfType(actualException)), + "Expected thrown exception to be {0} but it was {1}", + string.Join(" or ", expectedExceptionTypes.Select(eet => eet.Name)), + actualException.GetType().Name); + } + + public static IEnumerable DeeplyNestedPayloadTestCases(ProtocolType protocol) + { + int[] depths = new[] { 130, 4_000_000 }; + BondDataType[] types = new[] { BondDataType.BT_STRUCT, BondDataType.BT_LIST, BondDataType.BT_SET, BondDataType.BT_MAP }; + ushort[] versions = new ushort[] { 1, 2 }; + + var allCombinations = + from depth in depths + from type in types + from version in versions + select new { depth, type, version }; + + if (protocol == ProtocolType.COMPACT_PROTOCOL) + { + return + from c in allCombinations + // CBv2 skips structs by seeking not recursion, so omit that combination from the deeply nested tests + where !(c.version == 2 && c.type == BondDataType.BT_STRUCT) + select new object[] { c.depth, c.type, c.version }; + } + else + { + return from c in allCombinations select new object[] { c.depth, c.type, c.version }; + } + } } } diff --git a/cs/test/core/JsonParsingTests.cs b/cs/test/core/JsonParsingTests.cs index b18505165c..b7bca63e9e 100644 --- a/cs/test/core/JsonParsingTests.cs +++ b/cs/test/core/JsonParsingTests.cs @@ -1,8 +1,11 @@ namespace UnitTest { using System; + using System.Collections.Generic; using System.IO; + using System.Linq; using System.Text; + using System.Threading; using Bond; using Bond.Protocols; using Newtonsoft.Json; @@ -11,6 +14,31 @@ [TestFixture] public class JsonParsingTests { + [Test] + public void JsonParsing_66NestedObjects_Throws_JsonReaderException() + { + const int recurseCount = 33; // 33 pattern repetitions is 66 nestings. + + //{"a": [{"a": [ ... ]}]} + var json = String.Concat(Enumerable.Repeat(@"{""a"":[", recurseCount)); + json += String.Concat(Enumerable.Repeat("]}", recurseCount)); + + Assert.Catch(typeof(JsonReaderException), () => ParseJson(json)); + } + + [Test] + public void JsonParsing_64NestedObjects_Parsed_Successfully() + { + const int recurseCount = 32; // 32 pattern repetitions is 64 nestings. + + //{"a": [{"a": [ ... ]}]} + var json = String.Concat(Enumerable.Repeat(@"{""a"":[", recurseCount)); + json += String.Concat(Enumerable.Repeat("]}", recurseCount)); + + var parsedOutput = ParseJson(json); + Assert.IsNotNull(parsedOutput); + } + [Test] public void JsonParsing_EmptyStruct() { diff --git a/cs/test/core/NestedPayloadFactory.cs b/cs/test/core/NestedPayloadFactory.cs new file mode 100644 index 0000000000..792ba177e9 --- /dev/null +++ b/cs/test/core/NestedPayloadFactory.cs @@ -0,0 +1,214 @@ +namespace UnitTest +{ + using Bond; + using Bond.IO.Unsafe; + using Bond.Protocols; + + using NUnit; + using NUnit.Framework; + + using System; + using System.Linq; + + public static class NestedPayloadFactory + { + /// + /// Creates a payload for a struct like that has an unknown field that is deeply nested. + /// + /// The encoding protocol. Simple Binary is not supported. + /// The encoding protocol's version + /// How deeply to nest + /// The type of unknown field to nest. Only , , , and are supported. + /// A payload in the encoding protocol. + public static ArraySegment MakeWithUnknownField(ProtocolType protocol, ushort protocolVersion, int depth, BondDataType fieldType) + { + if (protocol == ProtocolType.SIMPLE_PROTOCOL) + { + throw new NotSupportedException("Simple Binary doesn't support unknown fields."); + } + + var buffer = new OutputBuffer(); + IProtocolWriter writer = MakeWriter(buffer, protocol, protocolVersion); + WriteDeeplyNestedPayload(writer, depth, fieldType); + return buffer.Data; + } + + /// + /// Creates a payload for the struct that has nested child elements. + /// + /// The encoding protocol. Simple Binary is not supported. + /// The encoding protocol's version + /// How deeply to nest + /// A payload in the encoding protocol. + public static ArraySegment MakeWithRecursiveChild(ProtocolType protocol, ushort protocolVersion, int depth) + { + var buffer = new OutputBuffer(); + IProtocolWriter writer = MakeWriter(buffer, protocol, protocolVersion); + WriteRecursiveChild(writer, depth); + return buffer.Data; + } + + private static IProtocolWriter MakeWriter(OutputBuffer buffer, ProtocolType protocol, ushort protocolVersion) + { + switch (protocol) + { + case ProtocolType.COMPACT_PROTOCOL: + return new CompactBinaryWriter(buffer, protocolVersion); + case ProtocolType.FAST_PROTOCOL: + return new FastBinaryWriter(buffer, protocolVersion); + case ProtocolType.SIMPLE_PROTOCOL: + return new SimpleBinaryWriter(buffer, protocolVersion); + default: + throw new NotSupportedException("Don't know how to make deeply nested payload for protocol " + protocol); + } + } + + private static void WriteDeeplyNestedPayload(IProtocolWriter writer, int depth, BondDataType fieldType) + { + ITwoPassProtocolWriter twoPassProtocolWriter = writer as ITwoPassProtocolWriter; + if (twoPassProtocolWriter != null) + { + IProtocolWriter firstPassWriter = twoPassProtocolWriter.GetFirstPassWriter(); + if (firstPassWriter != null) + { + WriteDeeplyNestedPayload(firstPassWriter, depth, fieldType); + } + } + + const ushort SomeUnknownFieldId = 50; // shouldn't overlap with any field in Structs.cs + + // use ClassWithStructProperties as a representative struct for testing + var structMetadata = Schema.GetRuntimeSchema(typeof(ClassWithStructProperties)).StructDef.metadata; + var fieldMetadata = new Metadata { name = "some_unknown_field", modifier = Modifier.Optional }; + + // open top-level field to hold nested values + writer.WriteStructBegin(structMetadata); + writer.WriteFieldBegin(fieldType, SomeUnknownFieldId, fieldMetadata); + + // open a level of nesting + for (int i = 0; i < depth; ++i) + { + switch (fieldType) + { + case BondDataType.BT_STRUCT: + writer.WriteStructBegin(structMetadata); + writer.WriteFieldBegin(fieldType, SomeUnknownFieldId, fieldMetadata); + break; + case BondDataType.BT_LIST: + case BondDataType.BT_SET: + writer.WriteContainerBegin(count: 1, elementType: fieldType); + break; + case BondDataType.BT_MAP: + writer.WriteContainerBegin(count: 1, keyType: BondDataType.BT_INT8, valueType: fieldType); + writer.WriteInt8(50); // map key + break; + default: + throw new NotSupportedException("Don't know how to create nested payload for field type " + fieldType); + } + } + + // write the value inside all the nesting + switch (fieldType) + { + case BondDataType.BT_STRUCT: + // empty struct + break; + case BondDataType.BT_LIST: + case BondDataType.BT_SET: + writer.WriteInt8(100); // sequence value + break; + case BondDataType.BT_MAP: + writer.WriteInt8(50); // map key + writer.WriteInt8(100); // map value + break; + default: + throw new NotSupportedException("Don't know how to create nested payload for field type " + fieldType); + } + + // close a level of nesting + for (int i = 0; i < depth; ++i) + { + switch (fieldType) + { + case BondDataType.BT_STRUCT: + writer.WriteFieldEnd(); + writer.WriteStructEnd(); + break; + case BondDataType.BT_LIST: + case BondDataType.BT_SET: + writer.WriteContainerEnd(); + break; + case BondDataType.BT_MAP: + writer.WriteContainerEnd(); + break; + default: + throw new NotSupportedException("Don't know how to create nested payload for field type " + fieldType); + } + } + + // close top-level field + writer.WriteFieldEnd(); + writer.WriteStructEnd(); + } + + private static void WriteRecursiveChild(IProtocolWriter writer, int depth) + { + ITwoPassProtocolWriter twoPassProtocolWriter = writer as ITwoPassProtocolWriter; + if (twoPassProtocolWriter != null) + { + IProtocolWriter firstPassWriter = twoPassProtocolWriter.GetFirstPassWriter(); + if (firstPassWriter != null) + { + WriteRecursiveChild(firstPassWriter, depth); + } + } + + // get the field id of the recursive child field in the test StructWithRecursiveReference struct + ushort childFieldId = Reflection + .GetSchemaFields(typeof(StructWithRecursiveReference)) + .Where(f => f.Name == nameof(StructWithRecursiveReference.Child)) + .Single() + .Id; + + StructDef structDef = Schema.GetRuntimeSchema(typeof(StructWithRecursiveReference)).StructDef; + FieldDef ValueFieldDef = structDef.fields.Where(fd => fd.id == 0).Single(); + FieldDef ChildFieldDef = structDef.fields.Where(fd => fd.id == 1).Single(); + + // sanity check the struct has the schema we expect + Assert.AreEqual(BondDataType.BT_UINT32, ValueFieldDef.type.id); + Assert.AreEqual(BondDataType.BT_LIST, ChildFieldDef.type.id); + + // open top-level struct + writer.WriteStructBegin(structDef.metadata); + + // open a level of nesting + for (int i = 0; i < depth; ++i) + { + writer.WriteFieldBegin(BondDataType.BT_UINT32, ValueFieldDef.id, ValueFieldDef.metadata); + writer.WriteUInt32(1000); + writer.WriteFieldEnd(); + + writer.WriteFieldBegin(BondDataType.BT_LIST, childFieldId, ChildFieldDef.metadata); + writer.WriteContainerBegin(1, BondDataType.BT_STRUCT); + writer.WriteStructBegin(structDef.metadata); + } + + // write an empty struct inside all the nesting + writer.WriteStructBegin(structDef.metadata); + writer.WriteFieldOmitted(BondDataType.BT_UINT32, ValueFieldDef.id, ValueFieldDef.metadata); + writer.WriteFieldOmitted(BondDataType.BT_LIST, childFieldId, ChildFieldDef.metadata); + writer.WriteStructEnd(); + + // close a level of nesting + for (int i = 0; i < depth; ++i) + { + writer.WriteStructEnd(); + writer.WriteContainerEnd(); + writer.WriteFieldEnd(); + } + + // close top-level struct + writer.WriteStructEnd(); + } + } +} diff --git a/cs/test/core/Structs.cs b/cs/test/core/Structs.cs index aaa54fadb8..eeafb4b270 100644 --- a/cs/test/core/Structs.cs +++ b/cs/test/core/Structs.cs @@ -226,4 +226,27 @@ public class CollectionsOfStructs [global::Bond.Id(3)] public NestedStructs[] a1 { get; set; } } + + [global::Bond.Schema] + public class StructWithRecursiveReference + { + [global::Bond.Id(0)] + public uint Value; + + [global::Bond.Id(1), global::Bond.Type(typeof(global::Bond.Tag.nullable))] + public StructWithRecursiveReference Child; + } + + [global::Bond.Schema] + public class StructWithArray + { + [global::Bond.Id(0)] + public uint N; + + [global::Bond.Id(1)] + public string Str; + + [global::Bond.Id(2)] + public double[] Items; + } } diff --git a/cs/test/core/UnitTest.bond b/cs/test/core/UnitTest.bond index 0bf4a047b3..9a0216be1f 100644 --- a/cs/test/core/UnitTest.bond +++ b/cs/test/core/UnitTest.bond @@ -63,6 +63,11 @@ struct FieldOfStructWithAliases 1: DateTime dt; } +struct NestedTypes +{ + 0: vector a; +} + struct ContainerOfStructWithAliases { 0: map>> m; diff --git a/cs/test/coreNS10/CoreNS10.csproj b/cs/test/coreNS10/CoreNS10.csproj index b30697a19d..1dded3a583 100644 --- a/cs/test/coreNS10/CoreNS10.csproj +++ b/cs/test/coreNS10/CoreNS10.csproj @@ -1,7 +1,7 @@  - net45 + net462 Debug;Release;Fields Library Properties @@ -61,7 +61,7 @@ - + diff --git a/cs/test/expressions/DeserializeCB.expressions b/cs/test/expressions/DeserializeCB.expressions index e71a3760e9..8ba8edbebe 100644 --- a/cs/test/expressions/DeserializeCB.expressions +++ b/cs/test/expressions/DeserializeCB.expressions @@ -3,144 +3,188 @@ .Block(ExpressionsTest.Example $Example_result) { .Block() { $Example_result = .New ExpressionsTest.Example(); - .Block( - Bond.BondDataType $fieldType, - System.UInt16 $fieldId) { - .Call $reader.ReadStructBegin(); - .Default(System.Void); - .Block() { - .Block( - Bond.BondDataType $fieldType, - System.UInt16 $fieldId) { - .Call $reader.ReadBaseBegin(); - .Default(System.Void); - .Default(System.Void); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(0)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + Bond.BondDataType $fieldType, + System.UInt16 $fieldId) { + .Call $reader.ReadStructBegin(); + .Default(System.Void); + .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { .Block() { - .If ($fieldType == .Constant(BT_LIST)) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_LIST)) { - .Block(System.Collections.Generic.List`1[System.UInt64] $Convert(Example_result).vvb_item) { - .Block(System.Int32 $Convert(Example_result).vvb_count) { - $Convert(Example_result).vvb_count = $count; - .If ($Convert(Example_result).vvb_count > 65536) { - $Convert(Example_result).vvb_count = 65536 - } .Else { - .Default(System.Void) - }; - (((ExpressionsTest.Base)$Example_result).vvb).Capacity = $Convert(Example_result).vvb_count - }; - .Loop { - .If ($count-- > 0) { - .Block() { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_UINT64)) { - .Block(System.UInt64 $Convert(Example_result).vvb_item_item) { - .Block(System.Int32 $Convert(Example_result).vvb_item_count) { - $Convert(Example_result).vvb_item_count = $count; - .If ($Convert(Example_result).vvb_item_count > 65536) { - $Convert(Example_result).vvb_item_count = 65536 - } .Else { - .Default(System.Void) - }; - $Convert(Example_result).vvb_item = .New System.Collections.Generic.List`1[System.UInt64]($Convert(Example_result).vvb_item_count) - }; - .Loop { - .If ($count-- > 0) { - .Block() { - $Convert(Example_result).vvb_item_item = .Call $reader.ReadUInt64(); - .Call $Convert(Example_result).vvb_item.Add($Convert(Example_result).vvb_item_item) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Default(System.Void) - } - } .Else { - .If ($elementType == .Constant(BT_UINT32)) { - .Block(System.UInt64 $Convert(Example_result).vvb_item_item) { - .Block(System.Int32 $Convert(Example_result).vvb_item_count) { - $Convert(Example_result).vvb_item_count = $count; - .If ($Convert(Example_result).vvb_item_count > 65536) { - $Convert(Example_result).vvb_item_count = 65536 - } .Else { - .Default(System.Void) - }; - $Convert(Example_result).vvb_item = .New System.Collections.Generic.List`1[System.UInt64]($Convert(Example_result).vvb_item_count) - }; - .Loop { - .If ($count-- > 0) { - .Block() { - $Convert(Example_result).vvb_item_item = (System.UInt64).Call $reader.ReadUInt32(); - .Call $Convert(Example_result).vvb_item.Add($Convert(Example_result).vvb_item_item) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Default(System.Void) - } - } .Else { - .If ($elementType == .Constant(BT_UINT16)) { - .Block(System.UInt64 $Convert(Example_result).vvb_item_item) { - .Block(System.Int32 $Convert(Example_result).vvb_item_count) { - $Convert(Example_result).vvb_item_count = $count; - .If ($Convert(Example_result).vvb_item_count > 65536) { - $Convert(Example_result).vvb_item_count = 65536 - } .Else { - .Default(System.Void) - }; - $Convert(Example_result).vvb_item = .New System.Collections.Generic.List`1[System.UInt64]($Convert(Example_result).vvb_item_count) - }; - .Loop { - .If ($count-- > 0) { - .Block() { - $Convert(Example_result).vvb_item_item = (System.UInt64).Call $reader.ReadUInt16(); - .Call $Convert(Example_result).vvb_item.Add($Convert(Example_result).vvb_item_item) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Default(System.Void) - } - } .Else { - .If ($elementType == .Constant(BT_UINT8)) { - .Block(System.UInt64 $Convert(Example_result).vvb_item_item) { - .Block(System.Int32 $Convert(Example_result).vvb_item_count) { - $Convert(Example_result).vvb_item_count = $count; - .If ($Convert(Example_result).vvb_item_count > 65536) { - $Convert(Example_result).vvb_item_count = 65536 + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + Bond.BondDataType $fieldType, + System.UInt16 $fieldId) { + .Call $reader.ReadBaseBegin(); + .Default(System.Void); + .Default(System.Void); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(0)) { + .Block() { + .If ($fieldType == .Constant(BT_LIST)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_LIST)) { + .Block(System.Collections.Generic.List`1[System.UInt64] $Convert(Example_result).vvb_item) { + .Block(System.Int32 $Convert(Example_result).vvb_count) { + $Convert(Example_result).vvb_count = $count; + .If ($Convert(Example_result).vvb_count > 65536) { + $Convert(Example_result).vvb_count = 65536 } .Else { .Default(System.Void) }; - $Convert(Example_result).vvb_item = .New System.Collections.Generic.List`1[System.UInt64]($Convert(Example_result).vvb_item_count) + (((ExpressionsTest.Base)$Example_result).vvb).Capacity = $Convert(Example_result).vvb_count }; .Loop { .If ($count-- > 0) { .Block() { - $Convert(Example_result).vvb_item_item = (System.UInt64).Call $reader.ReadUInt8(); - .Call $Convert(Example_result).vvb_item.Add($Convert(Example_result).vvb_item_item) + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_UINT64)) { + .Block(System.UInt64 $Convert(Example_result).vvb_item_item) { + .Block(System.Int32 $Convert(Example_result).vvb_item_count) { + $Convert(Example_result).vvb_item_count = $count; + .If ($Convert(Example_result).vvb_item_count > 65536) { + $Convert(Example_result).vvb_item_count = 65536 + } .Else { + .Default(System.Void) + }; + $Convert(Example_result).vvb_item = .New System.Collections.Generic.List`1[System.UInt64]($Convert(Example_result).vvb_item_count) + }; + .Loop { + .If ($count-- > 0) { + .Block() { + $Convert(Example_result).vvb_item_item = .Call $reader.ReadUInt64(); + .Call $Convert(Example_result).vvb_item.Add($Convert(Example_result).vvb_item_item) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Default(System.Void) + } + } .Else { + .If ($elementType == .Constant(BT_UINT32)) { + .Block(System.UInt64 $Convert(Example_result).vvb_item_item) { + .Block(System.Int32 $Convert(Example_result).vvb_item_count) { + $Convert(Example_result).vvb_item_count = $count; + .If ($Convert(Example_result).vvb_item_count > 65536) { + $Convert(Example_result).vvb_item_count = 65536 + } .Else { + .Default(System.Void) + }; + $Convert(Example_result).vvb_item = .New System.Collections.Generic.List`1[System.UInt64]($Convert(Example_result).vvb_item_count) + }; + .Loop { + .If ($count-- > 0) { + .Block() { + $Convert(Example_result).vvb_item_item = (System.UInt64).Call $reader.ReadUInt32(); + .Call $Convert(Example_result).vvb_item.Add($Convert(Example_result).vvb_item_item) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Default(System.Void) + } + } .Else { + .If ($elementType == .Constant(BT_UINT16)) { + .Block(System.UInt64 $Convert(Example_result).vvb_item_item) { + .Block(System.Int32 $Convert(Example_result).vvb_item_count) { + $Convert(Example_result).vvb_item_count = $count; + .If ($Convert(Example_result).vvb_item_count > 65536) { + $Convert(Example_result).vvb_item_count = 65536 + } .Else { + .Default(System.Void) + }; + $Convert(Example_result).vvb_item = .New System.Collections.Generic.List`1[System.UInt64]($Convert(Example_result).vvb_item_count) + }; + .Loop { + .If ($count-- > 0) { + .Block() { + $Convert(Example_result).vvb_item_item = (System.UInt64).Call $reader.ReadUInt16(); + .Call $Convert(Example_result).vvb_item.Add($Convert(Example_result).vvb_item_item) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Default(System.Void) + } + } .Else { + .If ($elementType == .Constant(BT_UINT8)) { + .Block(System.UInt64 $Convert(Example_result).vvb_item_item) { + .Block(System.Int32 $Convert(Example_result).vvb_item_count) { + $Convert(Example_result).vvb_item_count = $count; + .If ($Convert(Example_result).vvb_item_count > 65536) { + $Convert(Example_result).vvb_item_count = 65536 + } .Else { + .Default(System.Void) + }; + $Convert(Example_result).vvb_item = .New System.Collections.Generic.List`1[System.UInt64]($Convert(Example_result).vvb_item_count) + }; + .Loop { + .If ($count-- > 0) { + .Block() { + $Convert(Example_result).vvb_item_item = (System.UInt64).Call $reader.ReadUInt8(); + .Call $Convert(Example_result).vvb_item.Add($Convert(Example_result).vvb_item_item) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Default(System.Void) + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_UINT64), + $elementType) + } + } + } + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call (((ExpressionsTest.Base)$Example_result).vvb).Add($Convert(Example_result).vvb_item) } } .Else { .Break end { } @@ -151,1157 +195,1855 @@ } } .Else { .Invoke (.Lambda #Lambda2)( - .Constant(BT_UINT64), + .Constant(BT_LIST), $elementType) - } + }; + .Call $reader.ReadContainerEnd() } } - }; - .Call $reader.ReadContainerEnd() - }; - .Call (((ExpressionsTest.Base)$Example_result).vvb).Add($Convert(Example_result).vvb_item) + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(0)) { + .Block() { + .Default(System.Void); + .Break end { } } } .Else { - .Break end { } + .Call $reader.Skip($fieldType) } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(0)) { + .Break end { } + } .Else { + .Default(System.Void) } - .LabelTarget end:; - .Default(System.Void) } } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $elementType) - }; - .Call $reader.ReadContainerEnd() + .Block() { + .Default(System.Void); + .Break end { } + } + } } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(0)) { - .Block() { - .Default(System.Void); - .Break end { } + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldType == .Constant(BT_STOP_BASE)) { + .Default(System.Void) + } .Else { + .Block() { + .Call $reader.Skip($fieldType); + .Call $reader.ReadFieldEnd() + } + }; + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $reader.ReadBaseEnd(); + .Default(System.Void) } - } .Else { - .Call $reader.Skip($fieldType) - } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(0)) { - .Break end { } - } .Else { - .Default(System.Void) - } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldType == .Constant(BT_STOP_BASE)) { - .Default(System.Void) - } .Else { - .Block() { - .Call $reader.Skip($fieldType); - .Call $reader.ReadFieldEnd() } - }; - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $reader.ReadBaseEnd(); - .Default(System.Void) - } - }; - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(0)) { - .Block() { - .If ($fieldType == .Constant(BT_BOOL)) { - $Example_result._bool = .Call $reader.ReadBool() - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_BOOL), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(0)) { - .Block() { - .Default(System.Void); - .Break end { } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - } .Else { - .Call $reader.Skip($fieldType) } }; - .Call $reader.ReadFieldEnd(); .Call $reader.ReadFieldBegin( $fieldType, $fieldId); - .If ($fieldId > .Constant(0)) { - .Break end { } - } .Else { - .Default(System.Void) - } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(2)) { - .Block() { - .If ($fieldType == .Constant(BT_STRING)) { - $Example_result._str = .Call $reader.ReadString() - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_STRING), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(2)) { + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Default(System.Void); - .Break end { } - } - } .Else { - .Call $reader.Skip($fieldType) - } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(2)) { - .Break end { } - } .Else { - .Default(System.Void) - } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(12)) { - .Block() { - .If ($fieldType == .Constant(BT_UINT32)) { - $Example_result._uint32 = .Call $reader.ReadUInt32() - } .Else { - .If ($fieldType == .Constant(BT_UINT16)) { - $Example_result._uint32 = (System.UInt32).Call $reader.ReadUInt16() + .If ($fieldId == .Constant(0)) { + .Block() { + .If ($fieldType == .Constant(BT_BOOL)) { + $Example_result._bool = .Call $reader.ReadBool() + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_BOOL), + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } } .Else { - .If ($fieldType == .Constant(BT_UINT8)) { - $Example_result._uint32 = (System.UInt32).Call $reader.ReadUInt8() + .If ($fieldId > .Constant(0)) { + .Block() { + .Default(System.Void); + .Break end { } + } } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_UINT32), - $fieldType) + .Call $reader.Skip($fieldType) } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(0)) { + .Break end { } + } .Else { + .Default(System.Void) } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(12)) { - .Block() { - .Default(System.Void); - .Break end { } } } .Else { - .Call $reader.Skip($fieldType) - } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(12)) { - .Break end { } - } .Else { - .Default(System.Void) - } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(14)) { - .Block() { - .If ($fieldType == .Constant(BT_INT8)) { - $Example_result._int8 = .Call $reader.ReadInt8() - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT8), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(14)) { .Block() { .Default(System.Void); .Break end { } } - } .Else { - .Call $reader.Skip($fieldType) } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(14)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(17)) { - .Block() { - .If ($fieldType == .Constant(BT_INT64)) { - $Example_result._int64 = .Call $reader.ReadInt64() - } .Else { - .If ($fieldType == .Constant(BT_INT32)) { - $Example_result._int64 = (System.Int64).Call $reader.ReadInt32() - } .Else { - .If ($fieldType == .Constant(BT_INT16)) { - $Example_result._int64 = (System.Int64).Call $reader.ReadInt16() - } .Else { - .If ($fieldType == .Constant(BT_INT8)) { - $Example_result._int64 = (System.Int64).Call $reader.ReadInt8() + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(2)) { + .Block() { + .If ($fieldType == .Constant(BT_STRING)) { + $Example_result._str = .Call $reader.ReadString() } .Else { .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT64), + .Constant(BT_STRING), $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(2)) { + .Block() { + .Default(System.Void); + .Break end { } } + } .Else { + .Call $reader.Skip($fieldType) } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(2)) { + .Break end { } + } .Else { + .Default(System.Void) } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(17)) { - .Block() { - .Invoke (.Lambda #Lambda3)( - "Example", - "_int64"); - .Break end { } } } .Else { - .Call $reader.Skip($fieldType) - } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(17)) { - .Break end { } - } .Else { - .Default(System.Void) - } - } - } .Else { - .Block() { - .Invoke (.Lambda #Lambda3)( - "Example", - "_int64"); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(18)) { - .Block() { - .If ($fieldType == .Constant(BT_DOUBLE)) { - $Example_result._double = .Call $reader.ReadDouble() - } .Else { - .If ($fieldType == .Constant(BT_FLOAT)) { - $Example_result._double = (System.Double).Call $reader.ReadFloat() - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_DOUBLE), - $fieldType) - } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(18)) { .Block() { .Default(System.Void); .Break end { } } - } .Else { - .Call $reader.Skip($fieldType) } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(18)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(20)) { - .Block() { - .If ($fieldType == .Constant(BT_STRUCT)) { - .Block() { - .Block( - Bond.BondDataType $fieldType, - System.UInt16 $fieldId) { - .Call $reader.ReadStructBegin(); - .Default(System.Void); - .Default(System.Void); + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(12)) { + .Block() { + .If ($fieldType == .Constant(BT_UINT32)) { + $Example_result._uint32 = .Call $reader.ReadUInt32() + } .Else { + .If ($fieldType == .Constant(BT_UINT16)) { + $Example_result._uint32 = (System.UInt32).Call $reader.ReadUInt16() + } .Else { + .If ($fieldType == .Constant(BT_UINT8)) { + $Example_result._uint32 = (System.UInt32).Call $reader.ReadUInt8() + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_UINT32), + $fieldType) + } + } + }; + .Call $reader.ReadFieldEnd(); .Call $reader.ReadFieldBegin( $fieldType, $fieldId); - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(0)) { - .Block() { - .If ($fieldType == .Constant(BT_UINT32)) { - ($Example_result.guid).Data1 = .Call $reader.ReadUInt32() - } .Else { - .If ($fieldType == .Constant(BT_UINT16)) { - ($Example_result.guid).Data1 = (System.UInt32).Call $reader.ReadUInt16() - } .Else { - .If ($fieldType == .Constant(BT_UINT8)) { - ($Example_result.guid).Data1 = (System.UInt32).Call $reader.ReadUInt8() - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_UINT32), - $fieldType) - } - } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(0)) { - .Block() { - .Default(System.Void); - .Break end { } - } - } .Else { - .Call $reader.Skip($fieldType) - } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(0)) { - .Break end { } + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(12)) { + .Block() { + .Default(System.Void); + .Break end { } + } + } .Else { + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(12)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { + .Block() { + .Default(System.Void); + .Break end { } + } + } + } + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(14)) { + .Block() { + .If ($fieldType == .Constant(BT_INT8)) { + $Example_result._int8 = .Call $reader.ReadInt8() + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT8), + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(14)) { + .Block() { + .Default(System.Void); + .Break end { } + } + } .Else { + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(14)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { + .Block() { + .Default(System.Void); + .Break end { } + } + } + } + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(17)) { + .Block() { + .If ($fieldType == .Constant(BT_INT64)) { + $Example_result._int64 = .Call $reader.ReadInt64() + } .Else { + .If ($fieldType == .Constant(BT_INT32)) { + $Example_result._int64 = (System.Int64).Call $reader.ReadInt32() + } .Else { + .If ($fieldType == .Constant(BT_INT16)) { + $Example_result._int64 = (System.Int64).Call $reader.ReadInt16() + } .Else { + .If ($fieldType == .Constant(BT_INT8)) { + $Example_result._int64 = (System.Int64).Call $reader.ReadInt8() } .Else { - .Default(System.Void) + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT64), + $fieldType) } } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(17)) { + .Block() { + .Invoke (.Lambda #Lambda3)( + "Example", + "_int64"); + .Break end { } + } + } .Else { + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(17)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { + .Block() { + .Invoke (.Lambda #Lambda3)( + "Example", + "_int64"); + .Break end { } + } + } + } + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(18)) { + .Block() { + .If ($fieldType == .Constant(BT_DOUBLE)) { + $Example_result._double = .Call $reader.ReadDouble() + } .Else { + .If ($fieldType == .Constant(BT_FLOAT)) { + $Example_result._double = (System.Double).Call $reader.ReadFloat() } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } + .Invoke (.Lambda #Lambda2)( + .Constant(BT_DOUBLE), + $fieldType) } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(18)) { + .Block() { + .Default(System.Void); + .Break end { } } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(1)) { + } .Else { + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(18)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { + .Block() { + .Default(System.Void); + .Break end { } + } + } + } + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(20)) { + .Block() { + .If ($fieldType == .Constant(BT_STRUCT)) { + .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { .Block() { - .If ($fieldType == .Constant(BT_UINT16)) { - ($Example_result.guid).Data2 = .Call $reader.ReadUInt16() - } .Else { - .If ($fieldType == .Constant(BT_UINT8)) { - ($Example_result.guid).Data2 = (System.UInt16).Call $reader.ReadUInt8() - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_UINT16), - $fieldType) + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + Bond.BondDataType $fieldType, + System.UInt16 $fieldId) { + .Call $reader.ReadStructBegin(); + .Default(System.Void); + .Default(System.Void); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(0)) { + .Block() { + .If ($fieldType == .Constant(BT_UINT32)) { + ($Example_result.guid).Data1 = .Call $reader.ReadUInt32() + } .Else { + .If ($fieldType == .Constant(BT_UINT16)) { + ($Example_result.guid).Data1 = (System.UInt32).Call $reader.ReadUInt16() + } .Else { + .If ($fieldType == .Constant(BT_UINT8)) { + ($Example_result.guid).Data1 = (System.UInt32).Call $reader.ReadUInt8() + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_UINT32), + $fieldType) + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(0)) { + .Block() { + .Default(System.Void); + .Break end { } + } + } .Else { + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(0)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { + .Block() { + .Default(System.Void); + .Break end { } + } + } + } + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(1)) { + .Block() { + .If ($fieldType == .Constant(BT_UINT16)) { + ($Example_result.guid).Data2 = .Call $reader.ReadUInt16() + } .Else { + .If ($fieldType == .Constant(BT_UINT8)) { + ($Example_result.guid).Data2 = (System.UInt16).Call $reader.ReadUInt8() + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_UINT16), + $fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(1)) { + .Block() { + .Default(System.Void); + .Break end { } + } + } .Else { + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(1)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { + .Block() { + .Default(System.Void); + .Break end { } + } + } + } + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(2)) { + .Block() { + .If ($fieldType == .Constant(BT_UINT16)) { + ($Example_result.guid).Data3 = .Call $reader.ReadUInt16() + } .Else { + .If ($fieldType == .Constant(BT_UINT8)) { + ($Example_result.guid).Data3 = (System.UInt16).Call $reader.ReadUInt8() + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_UINT16), + $fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(2)) { + .Block() { + .Default(System.Void); + .Break end { } + } + } .Else { + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(2)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { + .Block() { + .Default(System.Void); + .Break end { } + } + } + } + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(3)) { + .Block() { + .If ($fieldType == .Constant(BT_UINT64)) { + ($Example_result.guid).Data4 = .Call $reader.ReadUInt64() + } .Else { + .If ($fieldType == .Constant(BT_UINT32)) { + ($Example_result.guid).Data4 = (System.UInt64).Call $reader.ReadUInt32() + } .Else { + .If ($fieldType == .Constant(BT_UINT16)) { + ($Example_result.guid).Data4 = (System.UInt64).Call $reader.ReadUInt16() + } .Else { + .If ($fieldType == .Constant(BT_UINT8)) { + ($Example_result.guid).Data4 = (System.UInt64).Call $reader.ReadUInt8() + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_UINT64), + $fieldType) + } + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(3)) { + .Block() { + .Default(System.Void); + .Break end { } + } + } .Else { + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(3)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { + .Block() { + .Default(System.Void); + .Break end { } + } + } + } + .LabelTarget end:; + .Loop { + .If ($fieldType != .Constant(BT_STOP)) { + .Block() { + .If ($fieldType == .Constant(BT_STOP_BASE)) { + .Default(System.Void) + } .Else { + .Block() { + .Call $reader.Skip($fieldType); + .Call $reader.ReadFieldEnd() + } + }; + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId) + } + } .Else { + .Break end { } + } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(1)) { - .Block() { - .Default(System.Void); - .Break end { } + .LabelTarget end:; + .Call $reader.ReadStructEnd(); + .Default(System.Void) } - } .Else { - .Call $reader.Skip($fieldType) } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(1)) { - .Break end { } - } .Else { - .Default(System.Void) + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_STRUCT), + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(20)) { + .Block() { + .Default(System.Void); + .Break end { } } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(2)) { - .Block() { - .If ($fieldType == .Constant(BT_UINT16)) { - ($Example_result.guid).Data3 = .Call $reader.ReadUInt16() + } .Else { + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(20)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { + .Block() { + .Default(System.Void); + .Break end { } + } + } + } + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(30)) { + .Block() { + .If ($fieldType == .Constant(BT_LIST)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_INT32)) { + .Block(System.Int32 $Example_result._int32Vector_item) { + .Block(System.Int32 $Example_result._int32Vector_count) { + $Example_result._int32Vector_count = $count; + .If ($Example_result._int32Vector_count > 65536) { + $Example_result._int32Vector_count = 65536 + } .Else { + .Default(System.Void) + }; + ($Example_result._int32Vector).Capacity = $Example_result._int32Vector_count + }; + .Loop { + .If ($count-- > 0) { + .Block() { + $Example_result._int32Vector_item = .Call $reader.ReadInt32(); + .Call ($Example_result._int32Vector).Add($Example_result._int32Vector_item) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Default(System.Void) + } } .Else { - .If ($fieldType == .Constant(BT_UINT8)) { - ($Example_result.guid).Data3 = (System.UInt16).Call $reader.ReadUInt8() + .If ($elementType == .Constant(BT_INT16)) { + .Block(System.Int32 $Example_result._int32Vector_item) { + .Block(System.Int32 $Example_result._int32Vector_count) { + $Example_result._int32Vector_count = $count; + .If ($Example_result._int32Vector_count > 65536) { + $Example_result._int32Vector_count = 65536 + } .Else { + .Default(System.Void) + }; + ($Example_result._int32Vector).Capacity = $Example_result._int32Vector_count + }; + .Loop { + .If ($count-- > 0) { + .Block() { + $Example_result._int32Vector_item = (System.Int32).Call $reader.ReadInt16(); + .Call ($Example_result._int32Vector).Add($Example_result._int32Vector_item) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Default(System.Void) + } } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_UINT16), - $fieldType) + .If ($elementType == .Constant(BT_INT8)) { + .Block(System.Int32 $Example_result._int32Vector_item) { + .Block(System.Int32 $Example_result._int32Vector_count) { + $Example_result._int32Vector_count = $count; + .If ($Example_result._int32Vector_count > 65536) { + $Example_result._int32Vector_count = 65536 + } .Else { + .Default(System.Void) + }; + ($Example_result._int32Vector).Capacity = $Example_result._int32Vector_count + }; + .Loop { + .If ($count-- > 0) { + .Block() { + $Example_result._int32Vector_item = (System.Int32).Call $reader.ReadInt8(); + .Call ($Example_result._int32Vector).Add($Example_result._int32Vector_item) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Default(System.Void) + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT32), + $elementType) + } } }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(2)) { - .Block() { - .Default(System.Void); - .Break end { } - } - } .Else { - .Call $reader.Skip($fieldType) + .Call $reader.ReadContainerEnd() } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(2)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(30)) { + .Block() { + .Default(System.Void); + .Break end { } } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(3)) { - .Block() { - .If ($fieldType == .Constant(BT_UINT64)) { - ($Example_result.guid).Data4 = .Call $reader.ReadUInt64() - } .Else { - .If ($fieldType == .Constant(BT_UINT32)) { - ($Example_result.guid).Data4 = (System.UInt64).Call $reader.ReadUInt32() - } .Else { - .If ($fieldType == .Constant(BT_UINT16)) { - ($Example_result.guid).Data4 = (System.UInt64).Call $reader.ReadUInt16() - } .Else { - .If ($fieldType == .Constant(BT_UINT8)) { - ($Example_result.guid).Data4 = (System.UInt64).Call $reader.ReadUInt8() + } .Else { + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(30)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { + .Block() { + .Default(System.Void); + .Break end { } + } + } + } + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(40)) { + .Block() { + .If ($fieldType == .Constant(BT_LIST)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_STRUCT)) { + .Block(ExpressionsTest.Nested $Example_result._nestedVector_item) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { + .Block() { + .Block() { + $Example_result._nestedVector_item = .New ExpressionsTest.Nested(); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + Bond.BondDataType $fieldType, + System.UInt16 $fieldId) { + .Call $reader.ReadStructBegin(); + .Default(System.Void); + .Default(System.Void); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(0)) { + .Block() { + .If ($fieldType == .Constant(BT_DOUBLE)) { + $Example_result._nestedVector_item._double = .Call $reader.ReadDouble() + } .Else { + .If ($fieldType == .Constant(BT_FLOAT)) { + $Example_result._nestedVector_item._double = (System.Double).Call $reader.ReadFloat() + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_DOUBLE), + $fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(0)) { + .Block() { + .Default(System.Void); + .Break end { } + } + } .Else { + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(0)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { + .Block() { + .Default(System.Void); + .Break end { } + } + } + } + .LabelTarget end:; + .Loop { + .If ($fieldType != .Constant(BT_STOP)) { + .Block() { + .If ($fieldType == .Constant(BT_STOP_BASE)) { + .Default(System.Void) + } .Else { + .Block() { + .Call $reader.Skip($fieldType); + .Call $reader.ReadFieldEnd() + } + }; + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $reader.ReadStructEnd(); + .Default(System.Void) + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + } + }; + .Call ($Example_result._nestedVector).Add($Example_result._nestedVector_item) + } } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_UINT64), - $fieldType) + .Break end { } } } + .LabelTarget end:; + .Default(System.Void) } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_STRUCT), + $elementType) }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(3)) { - .Block() { - .Default(System.Void); - .Break end { } - } - } .Else { - .Call $reader.Skip($fieldType) + .Call $reader.ReadContainerEnd() } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(3)) { - .Break end { } - } .Else { - .Default(System.Void) } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ($fieldType != .Constant(BT_STOP)) { - .Block() { - .If ($fieldType == .Constant(BT_STOP_BASE)) { - .Default(System.Void) - } .Else { - .Block() { - .Call $reader.Skip($fieldType); - .Call $reader.ReadFieldEnd() - } - }; - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId) - } - } .Else { - .Break end { } } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(40)) { + .Block() { + .Default(System.Void); + .Break end { } } - .LabelTarget end:; - .Call $reader.ReadStructEnd(); - .Default(System.Void) + } .Else { + .Call $reader.Skip($fieldType) } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(40)) { + .Break end { } + } .Else { + .Default(System.Void) } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_STRUCT), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(20)) { + } + } .Else { .Block() { .Default(System.Void); .Break end { } } - } .Else { - .Call $reader.Skip($fieldType) } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(20)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(30)) { - .Block() { - .If ($fieldType == .Constant(BT_LIST)) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_INT32)) { - .Block(System.Int32 $Example_result._int32Vector_item) { - .Block(System.Int32 $Example_result._int32Vector_count) { - $Example_result._int32Vector_count = $count; - .If ($Example_result._int32Vector_count > 65536) { - $Example_result._int32Vector_count = 65536 - } .Else { - .Default(System.Void) - }; - ($Example_result._int32Vector).Capacity = $Example_result._int32Vector_count - }; - .Loop { - .If ($count-- > 0) { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(50)) { + .Block() { + .If ($fieldType == .Constant(BT_LIST)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { .Block() { - $Example_result._int32Vector_item = .Call $reader.ReadInt32(); - .Call ($Example_result._int32Vector).Add($Example_result._int32Vector_item) + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_INT8)) { + $Example_result.b = .Call $reader.ReadBytes($count) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT8), + $elementType) + }; + .Call $reader.ReadContainerEnd() + } } - } .Else { - .Break end { } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } } - .LabelTarget end:; - .Default(System.Void) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(50)) { + .Block() { + .Default(System.Void); + .Break end { } } } .Else { - .If ($elementType == .Constant(BT_INT16)) { - .Block(System.Int32 $Example_result._int32Vector_item) { - .Block(System.Int32 $Example_result._int32Vector_count) { - $Example_result._int32Vector_count = $count; - .If ($Example_result._int32Vector_count > 65536) { - $Example_result._int32Vector_count = 65536 - } .Else { - .Default(System.Void) - }; - ($Example_result._int32Vector).Capacity = $Example_result._int32Vector_count - }; - .Loop { - .If ($count-- > 0) { - .Block() { - $Example_result._int32Vector_item = (System.Int32).Call $reader.ReadInt16(); - .Call ($Example_result._int32Vector).Add($Example_result._int32Vector_item) + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(50)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { + .Block() { + .Default(System.Void); + .Break end { } + } + } + } + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(51)) { + .Block() { + .If ($fieldType == .Constant(BT_LIST)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_LIST)) { + .Block(System.ArraySegment`1[System.Byte] $Example_result._blobList_item) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { + .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_INT8)) { + $Example_result._blobList_item = .Call $reader.ReadBytes($count) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT8), + $elementType) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call ($Example_result._blobList).Add($Example_result._blobList_item) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Default(System.Void) + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $elementType) + }; + .Call $reader.ReadContainerEnd() } - } .Else { - .Break end { } } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - .LabelTarget end:; - .Default(System.Void) } } .Else { - .If ($elementType == .Constant(BT_INT8)) { - .Block(System.Int32 $Example_result._int32Vector_item) { - .Block(System.Int32 $Example_result._int32Vector_count) { - $Example_result._int32Vector_count = $count; - .If ($Example_result._int32Vector_count > 65536) { - $Example_result._int32Vector_count = 65536 - } .Else { - .Default(System.Void) - }; - ($Example_result._int32Vector).Capacity = $Example_result._int32Vector_count - }; - .Loop { - .If ($count-- > 0) { - .Block() { - $Example_result._int32Vector_item = (System.Int32).Call $reader.ReadInt8(); - .Call ($Example_result._int32Vector).Add($Example_result._int32Vector_item) - } - } .Else { - .Break end { } + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(51)) { + .Block() { + .Default(System.Void); + .Break end { } + } + } .Else { + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(51)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { + .Block() { + .Default(System.Void); + .Break end { } + } + } + } + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(52)) { + .Block() { + .If ($fieldType == .Constant(BT_LIST)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_LIST)) { + .Block(System.ArraySegment`1[System.Byte] $Example_result._blobVector_item) { + .Block(System.Int32 $Example_result._blobVector_count) { + $Example_result._blobVector_count = $count; + .If ($Example_result._blobVector_count > 65536) { + $Example_result._blobVector_count = 65536 + } .Else { + .Default(System.Void) + }; + ($Example_result._blobVector).Capacity = $Example_result._blobVector_count + }; + .Loop { + .If ($count-- > 0) { + .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_INT8)) { + $Example_result._blobVector_item = .Call $reader.ReadBytes($count) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT8), + $elementType) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call ($Example_result._blobVector).Add($Example_result._blobVector_item) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Default(System.Void) + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $elementType) + }; + .Call $reader.ReadContainerEnd() } } - .LabelTarget end:; - .Default(System.Void) + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT32), - $elementType) } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(52)) { + .Block() { + .Default(System.Void); + .Break end { } } - }; - .Call $reader.ReadContainerEnd() + } .Else { + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(52)) { + .Break end { } + } .Else { + .Default(System.Void) } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(30)) { + } + } .Else { .Block() { .Default(System.Void); .Break end { } } - } .Else { - .Call $reader.Skip($fieldType) } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(30)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(40)) { - .Block() { - .If ($fieldType == .Constant(BT_LIST)) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_STRUCT)) { - .Block(ExpressionsTest.Nested $Example_result._nestedVector_item) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(53)) { + .Block() { + .If ($fieldType == .Constant(BT_MAP)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { .Block() { - .Block() { - $Example_result._nestedVector_item = .New ExpressionsTest.Nested(); - .Block( - Bond.BondDataType $fieldType, - System.UInt16 $fieldId) { - .Call $reader.ReadStructBegin(); - .Default(System.Void); - .Default(System.Void); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(0)) { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $keyType, + Bond.BondDataType $valueType) { + .Call $reader.ReadContainerBegin( + $count, + $keyType, + $valueType); + .If ($keyType == .Constant(BT_INT32)) { + .If ($valueType == .Constant(BT_LIST)) { + .Block( + System.Int32 $Example_result._blobMap_key, + System.ArraySegment`1[System.Byte] $Example_result._blobMap_value) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { .Block() { - .If ($fieldType == .Constant(BT_DOUBLE)) { - $Example_result._nestedVector_item._double = .Call $reader.ReadDouble() - } .Else { - .If ($fieldType == .Constant(BT_FLOAT)) { - $Example_result._nestedVector_item._double = (System.Double).Call $reader.ReadFloat() - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_DOUBLE), - $fieldType) + $Example_result._blobMap_key = .Call $reader.ReadInt32(); + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_INT8)) { + $Example_result._blobMap_value = .Call $reader.ReadBytes($count) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT8), + $elementType) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } + ($Example_result._blobMap).Item[$Example_result._blobMap_key] = $Example_result._blobMap_value } } .Else { - .If ($fieldId > .Constant(0)) { + .Break end { } + } + } + .LabelTarget end: + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $valueType) + } + } .Else { + .If ($keyType == .Constant(BT_INT16)) { + .If ($valueType == .Constant(BT_LIST)) { + .Block( + System.Int32 $Example_result._blobMap_key, + System.ArraySegment`1[System.Byte] $Example_result._blobMap_value) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { .Block() { + $Example_result._blobMap_key = (System.Int32).Call $reader.ReadInt16(); .Default(System.Void); - .Break end { } - } - } .Else { - .Call $reader.Skip($fieldType) - } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(0)) { - .Break end { } - } .Else { - .Default(System.Void) + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_INT8)) { + $Example_result._blobMap_value = .Call $reader.ReadBytes($count) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT8), + $elementType) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + ($Example_result._blobMap).Item[$Example_result._blobMap_key] = $Example_result._blobMap_value + } + } .Else { + .Break end { } + } } + .LabelTarget end: } } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $valueType) } - } - .LabelTarget end:; - .Loop { - .If ($fieldType != .Constant(BT_STOP)) { - .Block() { - .If ($fieldType == .Constant(BT_STOP_BASE)) { - .Default(System.Void) - } .Else { - .Block() { - .Call $reader.Skip($fieldType); - .Call $reader.ReadFieldEnd() + } .Else { + .If ($keyType == .Constant(BT_INT8)) { + .If ($valueType == .Constant(BT_LIST)) { + .Block( + System.Int32 $Example_result._blobMap_key, + System.ArraySegment`1[System.Byte] $Example_result._blobMap_value) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { + .Block() { + $Example_result._blobMap_key = (System.Int32).Call $reader.ReadInt8(); + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_INT8)) { + $Example_result._blobMap_value = .Call $reader.ReadBytes($count) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT8), + $elementType) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + ($Example_result._blobMap).Item[$Example_result._blobMap_key] = $Example_result._blobMap_value + } + } .Else { + .Break end { } + } } - }; - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId) + .LabelTarget end: + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $valueType) } } .Else { - .Break end { } + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT32), + $keyType) } } - .LabelTarget end:; - .Call $reader.ReadStructEnd(); - .Default(System.Void) - } - }; - .Call ($Example_result._nestedVector).Add($Example_result._nestedVector_item) + }; + .Call $reader.ReadContainerEnd() + } } - } .Else { - .Break end { } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } } - .LabelTarget end:; - .Default(System.Void) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_MAP), + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(53)) { + .Block() { + .Default(System.Void); + .Break end { } } } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_STRUCT), - $elementType) - }; - .Call $reader.ReadContainerEnd() + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(53)) { + .Break end { } + } .Else { + .Default(System.Void) } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(40)) { - .Block() { - .Default(System.Void); - .Break end { } } } .Else { - .Call $reader.Skip($fieldType) - } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(40)) { - .Break end { } - } .Else { - .Default(System.Void) - } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(50)) { - .Block() { - .If ($fieldType == .Constant(BT_LIST)) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_INT8)) { - $Example_result.b = .Call $reader.ReadBytes($count) - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT8), - $elementType) - }; - .Call $reader.ReadContainerEnd() - } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(50)) { .Block() { .Default(System.Void); .Break end { } } - } .Else { - .Call $reader.Skip($fieldType) } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(50)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(51)) { - .Block() { - .If ($fieldType == .Constant(BT_LIST)) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_LIST)) { - .Block(System.ArraySegment`1[System.Byte] $Example_result._blobList_item) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(54)) { + .Block() { + .If ($fieldType == .Constant(BT_LIST)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); .Block( System.Int32 $count, Bond.BondDataType $elementType) { .Call $reader.ReadContainerBegin( $count, $elementType); - .If ($elementType == .Constant(BT_INT8)) { - $Example_result._blobList_item = .Call $reader.ReadBytes($count) + .If ($elementType == .Constant(BT_LIST)) { + .Block() { + .Loop { + .If ($count-- > 0) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_INT8)) { + $Example_result._blobNullable = .Call $reader.ReadBytes($count) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT8), + $elementType) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + } + } .Else { + .Break end { } + } + } + .LabelTarget end: + } } .Else { .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT8), + .Constant(BT_LIST), $elementType) }; .Call $reader.ReadContainerEnd() - }; - .Call ($Example_result._blobList).Add($Example_result._blobList_item) + } } - } .Else { - .Break end { } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } } - .LabelTarget end:; - .Default(System.Void) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(54)) { + .Block() { + .Default(System.Void); + .Break end { } } } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $elementType) - }; - .Call $reader.ReadContainerEnd() + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(54)) { + .Break end { } + } .Else { + .Default(System.Void) } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(51)) { + } + } .Else { .Block() { .Default(System.Void); .Break end { } } - } .Else { - .Call $reader.Skip($fieldType) } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(51)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(52)) { - .Block() { - .If ($fieldType == .Constant(BT_LIST)) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_LIST)) { - .Block(System.ArraySegment`1[System.Byte] $Example_result._blobVector_item) { - .Block(System.Int32 $Example_result._blobVector_count) { - $Example_result._blobVector_count = $count; - .If ($Example_result._blobVector_count > 65536) { - $Example_result._blobVector_count = 65536 - } .Else { - .Default(System.Void) - }; - ($Example_result._blobVector).Capacity = $Example_result._blobVector_count - }; - .Loop { - .If ($count-- > 0) { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(60)) { + .Block() { + .If ($fieldType == .Constant(BT_MAP)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $keyType, + Bond.BondDataType $valueType) { + .Call $reader.ReadContainerBegin( + $count, + $keyType, + $valueType); + .If ($keyType == .Constant(BT_INT32)) { + .If ($valueType == .Constant(BT_DOUBLE)) { + .Block( + System.Int32 $Example_result._map_key, + System.Double $Example_result._map_value) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { + .Block() { + $Example_result._map_key = .Call $reader.ReadInt32(); + .Default(System.Void); + $Example_result._map_value = .Call $reader.ReadDouble(); + ($Example_result._map).Item[$Example_result._map_key] = $Example_result._map_value + } + } .Else { + .Break end { } + } + } + .LabelTarget end: + } + } .Else { + .If ($valueType == .Constant(BT_FLOAT)) { + .Block( + System.Int32 $Example_result._map_key, + System.Double $Example_result._map_value) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { + .Block() { + $Example_result._map_key = .Call $reader.ReadInt32(); + .Default(System.Void); + $Example_result._map_value = (System.Double).Call $reader.ReadFloat(); + ($Example_result._map).Item[$Example_result._map_key] = $Example_result._map_value + } + } .Else { + .Break end { } + } + } + .LabelTarget end: + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_DOUBLE), + $valueType) + } + } + } .Else { + .If ($keyType == .Constant(BT_INT16)) { + .If ($valueType == .Constant(BT_DOUBLE)) { + .Block( + System.Int32 $Example_result._map_key, + System.Double $Example_result._map_value) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { + .Block() { + $Example_result._map_key = (System.Int32).Call $reader.ReadInt16(); + .Default(System.Void); + $Example_result._map_value = .Call $reader.ReadDouble(); + ($Example_result._map).Item[$Example_result._map_key] = $Example_result._map_value + } + } .Else { + .Break end { } + } + } + .LabelTarget end: + } + } .Else { + .If ($valueType == .Constant(BT_FLOAT)) { + .Block( + System.Int32 $Example_result._map_key, + System.Double $Example_result._map_value) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { + .Block() { + $Example_result._map_key = (System.Int32).Call $reader.ReadInt16(); + .Default(System.Void); + $Example_result._map_value = (System.Double).Call $reader.ReadFloat(); + ($Example_result._map).Item[$Example_result._map_key] = $Example_result._map_value + } + } .Else { + .Break end { } + } + } + .LabelTarget end: + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_DOUBLE), + $valueType) + } + } + } .Else { + .If ($keyType == .Constant(BT_INT8)) { + .If ($valueType == .Constant(BT_DOUBLE)) { + .Block( + System.Int32 $Example_result._map_key, + System.Double $Example_result._map_value) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { + .Block() { + $Example_result._map_key = (System.Int32).Call $reader.ReadInt8(); + .Default(System.Void); + $Example_result._map_value = .Call $reader.ReadDouble(); + ($Example_result._map).Item[$Example_result._map_key] = $Example_result._map_value + } + } .Else { + .Break end { } + } + } + .LabelTarget end: + } + } .Else { + .If ($valueType == .Constant(BT_FLOAT)) { + .Block( + System.Int32 $Example_result._map_key, + System.Double $Example_result._map_value) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { + .Block() { + $Example_result._map_key = (System.Int32).Call $reader.ReadInt8(); + .Default(System.Void); + $Example_result._map_value = (System.Double).Call $reader.ReadFloat(); + ($Example_result._map).Item[$Example_result._map_key] = $Example_result._map_value + } + } .Else { + .Break end { } + } + } + .LabelTarget end: + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_DOUBLE), + $valueType) + } + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT32), + $keyType) + } + } + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_MAP), + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(60)) { + .Block() { + .Default(System.Void); + .Break end { } + } + } .Else { + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(60)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { + .Block() { + .Default(System.Void); + .Break end { } + } + } + } + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(70)) { + .Block() { + .If ($fieldType == .Constant(BT_LIST)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); .Block( System.Int32 $count, Bond.BondDataType $elementType) { @@ -1309,713 +2051,631 @@ $count, $elementType); .If ($elementType == .Constant(BT_INT8)) { - $Example_result._blobVector_item = .Call $reader.ReadBytes($count) + $Example_result._decimal = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(System.Decimal)) } .Else { .Invoke (.Lambda #Lambda2)( .Constant(BT_INT8), $elementType) }; .Call $reader.ReadContainerEnd() - }; - .Call ($Example_result._blobVector).Add($Example_result._blobVector_item) + } } - } .Else { - .Break end { } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } } - .LabelTarget end:; - .Default(System.Void) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(70)) { + .Block() { + .Default(System.Void); + .Break end { } } } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $elementType) - }; - .Call $reader.ReadContainerEnd() + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(70)) { + .Break end { } + } .Else { + .Default(System.Void) } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(52)) { + } + } .Else { .Block() { .Default(System.Void); .Break end { } } - } .Else { - .Call $reader.Skip($fieldType) } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(52)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(53)) { - .Block() { - .If ($fieldType == .Constant(BT_MAP)) { - .Block( - System.Int32 $count, - Bond.BondDataType $keyType, - Bond.BondDataType $valueType) { - .Call $reader.ReadContainerBegin( - $count, - $keyType, - $valueType); - .If ($keyType == .Constant(BT_INT32)) { - .If ($valueType == .Constant(BT_LIST)) { - .Block( - System.Int32 $Example_result._blobMap_key, - System.ArraySegment`1[System.Byte] $Example_result._blobMap_value) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { - .Block() { - $Example_result._blobMap_key = .Call $reader.ReadInt32(); - .Default(System.Void); - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_INT8)) { - $Example_result._blobMap_value = .Call $reader.ReadBytes($count) - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT8), - $elementType) - }; - .Call $reader.ReadContainerEnd() + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(71)) { + .Block() { + .If ($fieldType == .Constant(BT_LIST)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_LIST)) { + .Block(System.Decimal $Example_result._decList_item) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { + .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_INT8)) { + $Example_result._decList_item = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(System.Decimal)) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT8), + $elementType) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call ($Example_result._decList).Add($Example_result._decList_item) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Default(System.Void) + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $elementType) }; - ($Example_result._blobMap).Item[$Example_result._blobMap_key] = $Example_result._blobMap_value + .Call $reader.ReadContainerEnd() } - } .Else { - .Break end { } } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - .LabelTarget end: } } .Else { .Invoke (.Lambda #Lambda2)( .Constant(BT_LIST), - $valueType) + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(71)) { + .Block() { + .Default(System.Void); + .Break end { } } } .Else { - .If ($keyType == .Constant(BT_INT16)) { - .If ($valueType == .Constant(BT_LIST)) { - .Block( - System.Int32 $Example_result._blobMap_key, - System.ArraySegment`1[System.Byte] $Example_result._blobMap_value) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { - .Block() { - $Example_result._blobMap_key = (System.Int32).Call $reader.ReadInt16(); - .Default(System.Void); - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_INT8)) { - $Example_result._blobMap_value = .Call $reader.ReadBytes($count) - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT8), - $elementType) - }; - .Call $reader.ReadContainerEnd() - }; - ($Example_result._blobMap).Item[$Example_result._blobMap_key] = $Example_result._blobMap_value - } - } .Else { - .Break end { } - } - } - .LabelTarget end: - } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $valueType) - } - } .Else { - .If ($keyType == .Constant(BT_INT8)) { - .If ($valueType == .Constant(BT_LIST)) { - .Block( - System.Int32 $Example_result._blobMap_key, - System.ArraySegment`1[System.Byte] $Example_result._blobMap_value) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { - .Block() { - $Example_result._blobMap_key = (System.Int32).Call $reader.ReadInt8(); - .Default(System.Void); - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_INT8)) { - $Example_result._blobMap_value = .Call $reader.ReadBytes($count) - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT8), - $elementType) - }; - .Call $reader.ReadContainerEnd() - }; - ($Example_result._blobMap).Item[$Example_result._blobMap_key] = $Example_result._blobMap_value - } - } .Else { - .Break end { } - } - } - .LabelTarget end: - } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $valueType) - } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT32), - $keyType) - } - } - }; - .Call $reader.ReadContainerEnd() + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(71)) { + .Break end { } + } .Else { + .Default(System.Void) } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_MAP), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(53)) { - .Block() { - .Default(System.Void); - .Break end { } } } .Else { - .Call $reader.Skip($fieldType) - } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(53)) { - .Break end { } - } .Else { - .Default(System.Void) - } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(54)) { - .Block() { - .If ($fieldType == .Constant(BT_LIST)) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_LIST)) { - .Block() { - .Loop { - .If ($count-- > 0) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_INT8)) { - $Example_result._blobNullable = .Call $reader.ReadBytes($count) - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT8), - $elementType) - }; - .Call $reader.ReadContainerEnd() - } - } .Else { - .Break end { } - } - } - .LabelTarget end: - } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $elementType) - }; - .Call $reader.ReadContainerEnd() - } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(54)) { .Block() { .Default(System.Void); .Break end { } } - } .Else { - .Call $reader.Skip($fieldType) } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(54)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(60)) { - .Block() { - .If ($fieldType == .Constant(BT_MAP)) { - .Block( - System.Int32 $count, - Bond.BondDataType $keyType, - Bond.BondDataType $valueType) { - .Call $reader.ReadContainerBegin( - $count, - $keyType, - $valueType); - .If ($keyType == .Constant(BT_INT32)) { - .If ($valueType == .Constant(BT_DOUBLE)) { - .Block( - System.Int32 $Example_result._map_key, - System.Double $Example_result._map_value) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { - .Block() { - $Example_result._map_key = .Call $reader.ReadInt32(); - .Default(System.Void); - $Example_result._map_value = .Call $reader.ReadDouble(); - ($Example_result._map).Item[$Example_result._map_key] = $Example_result._map_value - } - } .Else { - .Break end { } - } - } - .LabelTarget end: - } - } .Else { - .If ($valueType == .Constant(BT_FLOAT)) { - .Block( - System.Int32 $Example_result._map_key, - System.Double $Example_result._map_value) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { - .Block() { - $Example_result._map_key = .Call $reader.ReadInt32(); - .Default(System.Void); - $Example_result._map_value = (System.Double).Call $reader.ReadFloat(); - ($Example_result._map).Item[$Example_result._map_key] = $Example_result._map_value - } - } .Else { - .Break end { } - } - } - .LabelTarget end: - } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_DOUBLE), - $valueType) - } - } - } .Else { - .If ($keyType == .Constant(BT_INT16)) { - .If ($valueType == .Constant(BT_DOUBLE)) { - .Block( - System.Int32 $Example_result._map_key, - System.Double $Example_result._map_value) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { - .Block() { - $Example_result._map_key = (System.Int32).Call $reader.ReadInt16(); - .Default(System.Void); - $Example_result._map_value = .Call $reader.ReadDouble(); - ($Example_result._map).Item[$Example_result._map_key] = $Example_result._map_value - } - } .Else { - .Break end { } - } - } - .LabelTarget end: - } - } .Else { - .If ($valueType == .Constant(BT_FLOAT)) { - .Block( - System.Int32 $Example_result._map_key, - System.Double $Example_result._map_value) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { - .Block() { - $Example_result._map_key = (System.Int32).Call $reader.ReadInt16(); - .Default(System.Void); - $Example_result._map_value = (System.Double).Call $reader.ReadFloat(); - ($Example_result._map).Item[$Example_result._map_key] = $Example_result._map_value + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(72)) { + .Block() { + .If ($fieldType == .Constant(BT_LIST)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_LIST)) { + .Block(System.Decimal $Example_result._decVector_item) { + .Block(System.Int32 $Example_result._decVector_count) { + $Example_result._decVector_count = $count; + .If ($Example_result._decVector_count > 65536) { + $Example_result._decVector_count = 65536 + } .Else { + .Default(System.Void) + }; + ($Example_result._decVector).Capacity = $Example_result._decVector_count + }; + .Loop { + .If ($count-- > 0) { + .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_INT8)) { + $Example_result._decVector_item = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(System.Decimal)) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT8), + $elementType) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call ($Example_result._decVector).Add($Example_result._decVector_item) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Default(System.Void) } } .Else { - .Break end { } - } + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $elementType) + }; + .Call $reader.ReadContainerEnd() } - .LabelTarget end: } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_DOUBLE), - $valueType) + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } } } .Else { - .If ($keyType == .Constant(BT_INT8)) { - .If ($valueType == .Constant(BT_DOUBLE)) { - .Block( - System.Int32 $Example_result._map_key, - System.Double $Example_result._map_value) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { - .Block() { - $Example_result._map_key = (System.Int32).Call $reader.ReadInt8(); - .Default(System.Void); - $Example_result._map_value = .Call $reader.ReadDouble(); - ($Example_result._map).Item[$Example_result._map_key] = $Example_result._map_value - } - } .Else { - .Break end { } - } - } - .LabelTarget end: - } - } .Else { - .If ($valueType == .Constant(BT_FLOAT)) { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(72)) { + .Block() { + .Default(System.Void); + .Break end { } + } + } .Else { + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(72)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { + .Block() { + .Default(System.Void); + .Break end { } + } + } + } + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(73)) { + .Block() { + .If ($fieldType == .Constant(BT_MAP)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); .Block( - System.Int32 $Example_result._map_key, - System.Double $Example_result._map_value) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { - .Block() { - $Example_result._map_key = (System.Int32).Call $reader.ReadInt8(); + System.Int32 $count, + Bond.BondDataType $keyType, + Bond.BondDataType $valueType) { + .Call $reader.ReadContainerBegin( + $count, + $keyType, + $valueType); + .If ($keyType == .Constant(BT_INT32)) { + .If ($valueType == .Constant(BT_LIST)) { + .Block( + System.Int32 $Example_result._decMap_key, + System.Decimal $Example_result._decMap_value) { .Default(System.Void); - $Example_result._map_value = (System.Double).Call $reader.ReadFloat(); - ($Example_result._map).Item[$Example_result._map_key] = $Example_result._map_value + .Loop { + .If ($count-- > 0) { + .Block() { + $Example_result._decMap_key = .Call $reader.ReadInt32(); + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_INT8)) { + $Example_result._decMap_value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(System.Decimal)) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT8), + $elementType) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + ($Example_result._decMap).Item[$Example_result._decMap_key] = $Example_result._decMap_value + } + } .Else { + .Break end { } + } + } + .LabelTarget end: } } .Else { - .Break end { } + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $valueType) } - } - .LabelTarget end: + } .Else { + .If ($keyType == .Constant(BT_INT16)) { + .If ($valueType == .Constant(BT_LIST)) { + .Block( + System.Int32 $Example_result._decMap_key, + System.Decimal $Example_result._decMap_value) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { + .Block() { + $Example_result._decMap_key = (System.Int32).Call $reader.ReadInt16(); + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_INT8)) { + $Example_result._decMap_value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(System.Decimal)) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT8), + $elementType) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + ($Example_result._decMap).Item[$Example_result._decMap_key] = $Example_result._decMap_value + } + } .Else { + .Break end { } + } + } + .LabelTarget end: + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $valueType) + } + } .Else { + .If ($keyType == .Constant(BT_INT8)) { + .If ($valueType == .Constant(BT_LIST)) { + .Block( + System.Int32 $Example_result._decMap_key, + System.Decimal $Example_result._decMap_value) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { + .Block() { + $Example_result._decMap_key = (System.Int32).Call $reader.ReadInt8(); + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_INT8)) { + $Example_result._decMap_value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(System.Decimal)) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT8), + $elementType) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + ($Example_result._decMap).Item[$Example_result._decMap_key] = $Example_result._decMap_value + } + } .Else { + .Break end { } + } + } + .LabelTarget end: + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $valueType) + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT32), + $keyType) + } + } + }; + .Call $reader.ReadContainerEnd() } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_DOUBLE), - $valueType) } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT32), - $keyType) } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_MAP), + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(73)) { + .Block() { + .Default(System.Void); + .Break end { } } - }; - .Call $reader.ReadContainerEnd() + } .Else { + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(73)) { + .Break end { } + } .Else { + .Default(System.Void) } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_MAP), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(60)) { - .Block() { - .Default(System.Void); - .Break end { } } } .Else { - .Call $reader.Skip($fieldType) - } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(60)) { - .Break end { } - } .Else { - .Default(System.Void) - } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(70)) { - .Block() { - .If ($fieldType == .Constant(BT_LIST)) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_INT8)) { - $Example_result._decimal = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(System.Decimal)) - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT8), - $elementType) - }; - .Call $reader.ReadContainerEnd() - } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(70)) { .Block() { .Default(System.Void); .Break end { } } - } .Else { - .Call $reader.Skip($fieldType) } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(70)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(71)) { - .Block() { - .If ($fieldType == .Constant(BT_LIST)) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_LIST)) { - .Block(System.Decimal $Example_result._decList_item) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(74)) { + .Block() { + .If ($fieldType == .Constant(BT_LIST)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); .Block( System.Int32 $count, Bond.BondDataType $elementType) { .Call $reader.ReadContainerBegin( $count, $elementType); - .If ($elementType == .Constant(BT_INT8)) { - $Example_result._decList_item = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(System.Decimal)) + .If ($elementType == .Constant(BT_LIST)) { + .Block() { + .Loop { + .If ($count-- > 0) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_INT8)) { + $Example_result._decNullable = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(System.Decimal)) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT8), + $elementType) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + } + } .Else { + .Break end { } + } + } + .LabelTarget end: + } } .Else { .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT8), + .Constant(BT_LIST), $elementType) }; .Call $reader.ReadContainerEnd() - }; - .Call ($Example_result._decList).Add($Example_result._decList_item) + } } - } .Else { - .Break end { } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } } - .LabelTarget end:; - .Default(System.Void) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(74)) { + .Block() { + .Default(System.Void); + .Break end { } } } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $elementType) - }; - .Call $reader.ReadContainerEnd() + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(74)) { + .Break end { } + } .Else { + .Default(System.Void) } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(71)) { + } + } .Else { .Block() { .Default(System.Void); .Break end { } } - } .Else { - .Call $reader.Skip($fieldType) } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(71)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(72)) { - .Block() { - .If ($fieldType == .Constant(BT_LIST)) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_LIST)) { - .Block(System.Decimal $Example_result._decVector_item) { - .Block(System.Int32 $Example_result._decVector_count) { - $Example_result._decVector_count = $count; - .If ($Example_result._decVector_count > 65536) { - $Example_result._decVector_count = 65536 - } .Else { - .Default(System.Void) - }; - ($Example_result._decVector).Capacity = $Example_result._decVector_count - }; - .Loop { - .If ($count-- > 0) { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(75)) { + .Block() { + .If ($fieldType == .Constant(BT_LIST)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); .Block( System.Int32 $count, Bond.BondDataType $elementType) { @@ -2023,7 +2683,7 @@ $count, $elementType); .If ($elementType == .Constant(BT_INT8)) { - $Example_result._decVector_item = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + $Example_result._decimal_req = .Call ExpressionsTest.BondTypeAliasConverter.Convert( .Call $reader.ReadBytes($count), .Default(System.Decimal)) } .Else { @@ -2032,1235 +2692,1025 @@ $elementType) }; .Call $reader.ReadContainerEnd() - }; - .Call ($Example_result._decVector).Add($Example_result._decVector_item) + } } - } .Else { - .Break end { } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } } - .LabelTarget end:; - .Default(System.Void) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(75)) { + .Block() { + .Invoke (.Lambda #Lambda3)( + "Example", + "_decimal_req"); + .Break end { } } } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $elementType) - }; - .Call $reader.ReadContainerEnd() + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(75)) { + .Break end { } + } .Else { + .Default(System.Void) } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(72)) { + } + } .Else { .Block() { - .Default(System.Void); + .Invoke (.Lambda #Lambda3)( + "Example", + "_decimal_req"); .Break end { } } - } .Else { - .Call $reader.Skip($fieldType) } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(72)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(73)) { - .Block() { - .If ($fieldType == .Constant(BT_MAP)) { - .Block( - System.Int32 $count, - Bond.BondDataType $keyType, - Bond.BondDataType $valueType) { - .Call $reader.ReadContainerBegin( - $count, - $keyType, - $valueType); - .If ($keyType == .Constant(BT_INT32)) { - .If ($valueType == .Constant(BT_LIST)) { - .Block( - System.Int32 $Example_result._decMap_key, - System.Decimal $Example_result._decMap_value) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { - .Block() { - $Example_result._decMap_key = .Call $reader.ReadInt32(); - .Default(System.Void); - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_INT8)) { - $Example_result._decMap_value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(System.Decimal)) - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT8), - $elementType) - }; - .Call $reader.ReadContainerEnd() - }; - ($Example_result._decMap).Item[$Example_result._decMap_key] = $Example_result._decMap_value - } - } .Else { - .Break end { } - } - } - .LabelTarget end: - } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $valueType) - } - } .Else { - .If ($keyType == .Constant(BT_INT16)) { - .If ($valueType == .Constant(BT_LIST)) { - .Block( - System.Int32 $Example_result._decMap_key, - System.Decimal $Example_result._decMap_value) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { - .Block() { - $Example_result._decMap_key = (System.Int32).Call $reader.ReadInt16(); - .Default(System.Void); - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_INT8)) { - $Example_result._decMap_value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(System.Decimal)) - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT8), - $elementType) - }; - .Call $reader.ReadContainerEnd() - }; - ($Example_result._decMap).Item[$Example_result._decMap_key] = $Example_result._decMap_value - } - } .Else { - .Break end { } - } - } - .LabelTarget end: - } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $valueType) - } - } .Else { - .If ($keyType == .Constant(BT_INT8)) { - .If ($valueType == .Constant(BT_LIST)) { - .Block( - System.Int32 $Example_result._decMap_key, - System.Decimal $Example_result._decMap_value) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { - .Block() { - $Example_result._decMap_key = (System.Int32).Call $reader.ReadInt8(); - .Default(System.Void); - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_INT8)) { - $Example_result._decMap_value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(System.Decimal)) - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT8), - $elementType) - }; - .Call $reader.ReadContainerEnd() - }; - ($Example_result._decMap).Item[$Example_result._decMap_key] = $Example_result._decMap_value - } + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(80)) { + .Block() { + .If ($fieldType == .Constant(BT_LIST)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_INT8)) { + $Example_result._reference = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(ExpressionsTest.RefObject)) } .Else { - .Break end { } - } + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT8), + $elementType) + }; + .Call $reader.ReadContainerEnd() } - .LabelTarget end: } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $valueType) + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT32), - $keyType) } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(80)) { + .Block() { + .Default(System.Void); + .Break end { } } - }; - .Call $reader.ReadContainerEnd() + } .Else { + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(80)) { + .Break end { } + } .Else { + .Default(System.Void) } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_MAP), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(73)) { + } + } .Else { .Block() { .Default(System.Void); .Break end { } } - } .Else { - .Call $reader.Skip($fieldType) } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(73)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(74)) { - .Block() { - .If ($fieldType == .Constant(BT_LIST)) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_LIST)) { - .Block() { - .Loop { - .If ($count-- > 0) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_INT8)) { - $Example_result._decNullable = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(System.Decimal)) - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT8), - $elementType) - }; - .Call $reader.ReadContainerEnd() + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(81)) { + .Block() { + .If ($fieldType == .Constant(BT_LIST)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_LIST)) { + .Block(ExpressionsTest.RefObject $Example_result._refList_item) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { + .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_INT8)) { + $Example_result._refList_item = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(ExpressionsTest.RefObject)) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT8), + $elementType) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call ($Example_result._refList).Add($Example_result._refList_item) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Default(System.Void) + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $elementType) + }; + .Call $reader.ReadContainerEnd() + } } - } .Else { - .Break end { } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } } - .LabelTarget end: + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(81)) { + .Block() { + .Default(System.Void); + .Break end { } } } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $elementType) - }; - .Call $reader.ReadContainerEnd() + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(81)) { + .Break end { } + } .Else { + .Default(System.Void) } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(74)) { + } + } .Else { .Block() { .Default(System.Void); .Break end { } } - } .Else { - .Call $reader.Skip($fieldType) } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(74)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(75)) { - .Block() { - .If ($fieldType == .Constant(BT_LIST)) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_INT8)) { - $Example_result._decimal_req = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(System.Decimal)) + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(82)) { + .Block() { + .If ($fieldType == .Constant(BT_LIST)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_LIST)) { + .Block(ExpressionsTest.RefObject $Example_result._refVector_item) { + .Block(System.Int32 $Example_result._refVector_count) { + $Example_result._refVector_count = $count; + .If ($Example_result._refVector_count > 65536) { + $Example_result._refVector_count = 65536 + } .Else { + .Default(System.Void) + }; + ($Example_result._refVector).Capacity = $Example_result._refVector_count + }; + .Loop { + .If ($count-- > 0) { + .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_INT8)) { + $Example_result._refVector_item = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(ExpressionsTest.RefObject)) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT8), + $elementType) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call ($Example_result._refVector).Add($Example_result._refVector_item) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Default(System.Void) + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $elementType) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(82)) { + .Block() { + .Default(System.Void); + .Break end { } + } } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT8), - $elementType) - }; - .Call $reader.ReadContainerEnd() + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(82)) { + .Break end { } + } .Else { + .Default(System.Void) } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(75)) { - .Block() { - .Invoke (.Lambda #Lambda3)( - "Example", - "_decimal_req"); - .Break end { } } } .Else { - .Call $reader.Skip($fieldType) - } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(75)) { - .Break end { } - } .Else { - .Default(System.Void) - } - } - } .Else { - .Block() { - .Invoke (.Lambda #Lambda3)( - "Example", - "_decimal_req"); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(80)) { - .Block() { - .If ($fieldType == .Constant(BT_LIST)) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_INT8)) { - $Example_result._reference = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(ExpressionsTest.RefObject)) - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT8), - $elementType) - }; - .Call $reader.ReadContainerEnd() - } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(80)) { .Block() { .Default(System.Void); .Break end { } } - } .Else { - .Call $reader.Skip($fieldType) } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(80)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(81)) { - .Block() { - .If ($fieldType == .Constant(BT_LIST)) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_LIST)) { - .Block(ExpressionsTest.RefObject $Example_result._refList_item) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(83)) { + .Block() { + .If ($fieldType == .Constant(BT_MAP)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); .Block( System.Int32 $count, - Bond.BondDataType $elementType) { + Bond.BondDataType $keyType, + Bond.BondDataType $valueType) { .Call $reader.ReadContainerBegin( $count, - $elementType); - .If ($elementType == .Constant(BT_INT8)) { - $Example_result._refList_item = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(ExpressionsTest.RefObject)) + $keyType, + $valueType); + .If ($keyType == .Constant(BT_INT32)) { + .If ($valueType == .Constant(BT_LIST)) { + .Block( + System.Int32 $Example_result._refMap_key, + ExpressionsTest.RefObject $Example_result._refMap_value) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { + .Block() { + $Example_result._refMap_key = .Call $reader.ReadInt32(); + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_INT8)) { + $Example_result._refMap_value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(ExpressionsTest.RefObject)) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT8), + $elementType) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + ($Example_result._refMap).Item[$Example_result._refMap_key] = $Example_result._refMap_value + } + } .Else { + .Break end { } + } + } + .LabelTarget end: + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $valueType) + } } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT8), - $elementType) + .If ($keyType == .Constant(BT_INT16)) { + .If ($valueType == .Constant(BT_LIST)) { + .Block( + System.Int32 $Example_result._refMap_key, + ExpressionsTest.RefObject $Example_result._refMap_value) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { + .Block() { + $Example_result._refMap_key = (System.Int32).Call $reader.ReadInt16(); + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_INT8)) { + $Example_result._refMap_value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(ExpressionsTest.RefObject)) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT8), + $elementType) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + ($Example_result._refMap).Item[$Example_result._refMap_key] = $Example_result._refMap_value + } + } .Else { + .Break end { } + } + } + .LabelTarget end: + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $valueType) + } + } .Else { + .If ($keyType == .Constant(BT_INT8)) { + .If ($valueType == .Constant(BT_LIST)) { + .Block( + System.Int32 $Example_result._refMap_key, + ExpressionsTest.RefObject $Example_result._refMap_value) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { + .Block() { + $Example_result._refMap_key = (System.Int32).Call $reader.ReadInt8(); + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_INT8)) { + $Example_result._refMap_value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(ExpressionsTest.RefObject)) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT8), + $elementType) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + ($Example_result._refMap).Item[$Example_result._refMap_key] = $Example_result._refMap_value + } + } .Else { + .Break end { } + } + } + .LabelTarget end: + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_LIST), + $valueType) + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT32), + $keyType) + } + } }; .Call $reader.ReadContainerEnd() - }; - .Call ($Example_result._refList).Add($Example_result._refList_item) + } } - } .Else { - .Break end { } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } } - .LabelTarget end:; - .Default(System.Void) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_MAP), + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(83)) { + .Block() { + .Default(System.Void); + .Break end { } } } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $elementType) - }; - .Call $reader.ReadContainerEnd() + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(83)) { + .Break end { } + } .Else { + .Default(System.Void) } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(81)) { + } + } .Else { .Block() { .Default(System.Void); .Break end { } } - } .Else { - .Call $reader.Skip($fieldType) } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(81)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(82)) { - .Block() { - .If ($fieldType == .Constant(BT_LIST)) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_LIST)) { - .Block(ExpressionsTest.RefObject $Example_result._refVector_item) { - .Block(System.Int32 $Example_result._refVector_count) { - $Example_result._refVector_count = $count; - .If ($Example_result._refVector_count > 65536) { - $Example_result._refVector_count = 65536 - } .Else { - .Default(System.Void) - }; - ($Example_result._refVector).Capacity = $Example_result._refVector_count - }; - .Loop { - .If ($count-- > 0) { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(84)) { + .Block() { + .If ($fieldType == .Constant(BT_LIST)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); .Block( System.Int32 $count, Bond.BondDataType $elementType) { .Call $reader.ReadContainerBegin( $count, $elementType); - .If ($elementType == .Constant(BT_INT8)) { - $Example_result._refVector_item = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(ExpressionsTest.RefObject)) + .If ($elementType == .Constant(BT_LIST)) { + .Block() { + $Example_result._refNullable = .Default(ExpressionsTest.RefObject); + .Loop { + .If ($count-- > 0) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_INT8)) { + $Example_result._refNullable = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(ExpressionsTest.RefObject)) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT8), + $elementType) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + } + } .Else { + .Break end { } + } + } + .LabelTarget end: + } } .Else { .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT8), + .Constant(BT_LIST), $elementType) }; .Call $reader.ReadContainerEnd() - }; - .Call ($Example_result._refVector).Add($Example_result._refVector_item) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Default(System.Void) - } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $elementType) - }; - .Call $reader.ReadContainerEnd() - } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(82)) { - .Block() { - .Default(System.Void); - .Break end { } - } - } .Else { - .Call $reader.Skip($fieldType) - } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(82)) { - .Break end { } - } .Else { - .Default(System.Void) - } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(83)) { - .Block() { - .If ($fieldType == .Constant(BT_MAP)) { - .Block( - System.Int32 $count, - Bond.BondDataType $keyType, - Bond.BondDataType $valueType) { - .Call $reader.ReadContainerBegin( - $count, - $keyType, - $valueType); - .If ($keyType == .Constant(BT_INT32)) { - .If ($valueType == .Constant(BT_LIST)) { - .Block( - System.Int32 $Example_result._refMap_key, - ExpressionsTest.RefObject $Example_result._refMap_value) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { - .Block() { - $Example_result._refMap_key = .Call $reader.ReadInt32(); - .Default(System.Void); - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_INT8)) { - $Example_result._refMap_value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(ExpressionsTest.RefObject)) - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT8), - $elementType) - }; - .Call $reader.ReadContainerEnd() - }; - ($Example_result._refMap).Item[$Example_result._refMap_key] = $Example_result._refMap_value } - } .Else { - .Break end { } } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - .LabelTarget end: } } .Else { .Invoke (.Lambda #Lambda2)( .Constant(BT_LIST), - $valueType) + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(84)) { + .Block() { + .Default(System.Void); + .Break end { } } } .Else { - .If ($keyType == .Constant(BT_INT16)) { - .If ($valueType == .Constant(BT_LIST)) { - .Block( - System.Int32 $Example_result._refMap_key, - ExpressionsTest.RefObject $Example_result._refMap_value) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { - .Block() { - $Example_result._refMap_key = (System.Int32).Call $reader.ReadInt16(); - .Default(System.Void); - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_INT8)) { - $Example_result._refMap_value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(ExpressionsTest.RefObject)) - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT8), - $elementType) - }; - .Call $reader.ReadContainerEnd() - }; - ($Example_result._refMap).Item[$Example_result._refMap_key] = $Example_result._refMap_value - } - } .Else { - .Break end { } - } - } - .LabelTarget end: - } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $valueType) - } - } .Else { - .If ($keyType == .Constant(BT_INT8)) { - .If ($valueType == .Constant(BT_LIST)) { - .Block( - System.Int32 $Example_result._refMap_key, - ExpressionsTest.RefObject $Example_result._refMap_value) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { - .Block() { - $Example_result._refMap_key = (System.Int32).Call $reader.ReadInt8(); - .Default(System.Void); - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_INT8)) { - $Example_result._refMap_value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(ExpressionsTest.RefObject)) - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT8), - $elementType) - }; - .Call $reader.ReadContainerEnd() - }; - ($Example_result._refMap).Item[$Example_result._refMap_key] = $Example_result._refMap_value - } - } .Else { - .Break end { } - } - } - .LabelTarget end: - } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $valueType) - } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT32), - $keyType) - } - } - }; - .Call $reader.ReadContainerEnd() + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(84)) { + .Break end { } + } .Else { + .Default(System.Void) } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_MAP), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(83)) { - .Block() { - .Default(System.Void); - .Break end { } } } .Else { - .Call $reader.Skip($fieldType) - } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(83)) { - .Break end { } - } .Else { - .Default(System.Void) - } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(84)) { - .Block() { - .If ($fieldType == .Constant(BT_LIST)) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_LIST)) { - .Block() { - $Example_result._refNullable = .Default(ExpressionsTest.RefObject); - .Loop { - .If ($count-- > 0) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_INT8)) { - $Example_result._refNullable = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(ExpressionsTest.RefObject)) - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT8), - $elementType) - }; - .Call $reader.ReadContainerEnd() - } - } .Else { - .Break end { } - } - } - .LabelTarget end: - } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $elementType) - }; - .Call $reader.ReadContainerEnd() - } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_LIST), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(84)) { .Block() { .Default(System.Void); .Break end { } } - } .Else { - .Call $reader.Skip($fieldType) } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(84)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(85)) { - .Block() { - .If ($fieldType == .Constant(BT_STRUCT)) { - .Block() { - .Block( - Bond.BondDataType $fieldType, - System.UInt16 $fieldId) { - .Call $reader.ReadStructBegin(); - .Default(System.Void); - .Default(System.Void); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(0)) { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(85)) { + .Block() { + .If ($fieldType == .Constant(BT_STRUCT)) { + .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { .Block() { - .If ($fieldType == .Constant(BT_INT64)) { - ($Example_result._dt).value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadInt64(), - .Default(System.DateTime)) - } .Else { - .If ($fieldType == .Constant(BT_INT32)) { - ($Example_result._dt).value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - (System.Int64).Call $reader.ReadInt32(), - .Default(System.DateTime)) - } .Else { - .If ($fieldType == .Constant(BT_INT16)) { - ($Example_result._dt).value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - (System.Int64).Call $reader.ReadInt16(), - .Default(System.DateTime)) + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + Bond.BondDataType $fieldType, + System.UInt16 $fieldId) { + .Call $reader.ReadStructBegin(); + .Default(System.Void); + .Default(System.Void); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(0)) { + .Block() { + .If ($fieldType == .Constant(BT_INT64)) { + ($Example_result._dt).value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadInt64(), + .Default(System.DateTime)) + } .Else { + .If ($fieldType == .Constant(BT_INT32)) { + ($Example_result._dt).value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + (System.Int64).Call $reader.ReadInt32(), + .Default(System.DateTime)) + } .Else { + .If ($fieldType == .Constant(BT_INT16)) { + ($Example_result._dt).value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + (System.Int64).Call $reader.ReadInt16(), + .Default(System.DateTime)) + } .Else { + .If ($fieldType == .Constant(BT_INT8)) { + ($Example_result._dt).value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + (System.Int64).Call $reader.ReadInt8(), + .Default(System.DateTime)) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT64), + $fieldType) + } + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(0)) { + .Block() { + .Default(System.Void); + .Break end { } + } + } .Else { + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(0)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } } .Else { - .If ($fieldType == .Constant(BT_INT8)) { - ($Example_result._dt).value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - (System.Int64).Call $reader.ReadInt8(), - .Default(System.DateTime)) - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT64), - $fieldType) + .Block() { + .Default(System.Void); + .Break end { } } } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(0)) { - .Block() { - .Default(System.Void); - .Break end { } + .LabelTarget end:; + .Loop { + .If ($fieldType != .Constant(BT_STOP)) { + .Block() { + .If ($fieldType == .Constant(BT_STOP_BASE)) { + .Default(System.Void) + } .Else { + .Block() { + .Call $reader.Skip($fieldType); + .Call $reader.ReadFieldEnd() + } + }; + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $reader.ReadStructEnd(); + .Default(System.Void) } - } .Else { - .Call $reader.Skip($fieldType) } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(0)) { - .Break end { } - } .Else { - .Default(System.Void) + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ($fieldType != .Constant(BT_STOP)) { - .Block() { - .If ($fieldType == .Constant(BT_STOP_BASE)) { - .Default(System.Void) - } .Else { - .Block() { - .Call $reader.Skip($fieldType); - .Call $reader.ReadFieldEnd() - } - }; - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId) - } - } .Else { - .Break end { } } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_STRUCT), + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(85)) { + .Block() { + .Default(System.Void); + .Break end { } } - .LabelTarget end:; - .Call $reader.ReadStructEnd(); - .Default(System.Void) + } .Else { + .Call $reader.Skip($fieldType) } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(85)) { + .Break end { } + } .Else { + .Default(System.Void) } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_STRUCT), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(85)) { + } + } .Else { .Block() { .Default(System.Void); .Break end { } } - } .Else { - .Call $reader.Skip($fieldType) } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(85)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(86)) { - .Block() { - .If ($fieldType == .Constant(BT_STRUCT)) { - .Block() { - .Block( - Bond.BondDataType $fieldType, - System.UInt16 $fieldId) { - .Call $reader.ReadStructBegin(); - .Default(System.Void); - .Default(System.Void); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(0)) { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(86)) { + .Block() { + .If ($fieldType == .Constant(BT_STRUCT)) { + .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { .Block() { - .If ($fieldType == .Constant(BT_INT64)) { - ($Example_result._dt2).value = (System.Nullable`1[System.DateTime]).Call ExpressionsTest.BondTypeAliasConverter.Convert( - (System.Int64)((System.Nullable`1[System.Int64]).Call $reader.ReadInt64()), - .Default(System.DateTime)) - } .Else { - .If ($fieldType == .Constant(BT_INT32)) { - ($Example_result._dt2).value = (System.Nullable`1[System.DateTime]).Call ExpressionsTest.BondTypeAliasConverter.Convert( - (System.Int64)((System.Nullable`1[System.Int64]).Call $reader.ReadInt32()), - .Default(System.DateTime)) - } .Else { - .If ($fieldType == .Constant(BT_INT16)) { - ($Example_result._dt2).value = (System.Nullable`1[System.DateTime]).Call ExpressionsTest.BondTypeAliasConverter.Convert( - (System.Int64)((System.Nullable`1[System.Int64]).Call $reader.ReadInt16()), - .Default(System.DateTime)) + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + Bond.BondDataType $fieldType, + System.UInt16 $fieldId) { + .Call $reader.ReadStructBegin(); + .Default(System.Void); + .Default(System.Void); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(0)) { + .Block() { + .If ($fieldType == .Constant(BT_INT64)) { + ($Example_result._dt2).value = (System.Nullable`1[System.DateTime]).Call ExpressionsTest.BondTypeAliasConverter.Convert( + (System.Int64)((System.Nullable`1[System.Int64]).Call $reader.ReadInt64()), + .Default(System.DateTime)) + } .Else { + .If ($fieldType == .Constant(BT_INT32)) { + ($Example_result._dt2).value = (System.Nullable`1[System.DateTime]).Call ExpressionsTest.BondTypeAliasConverter.Convert( + (System.Int64)((System.Nullable`1[System.Int64]).Call $reader.ReadInt32()), + .Default(System.DateTime)) + } .Else { + .If ($fieldType == .Constant(BT_INT16)) { + ($Example_result._dt2).value = (System.Nullable`1[System.DateTime]).Call ExpressionsTest.BondTypeAliasConverter.Convert( + (System.Int64)((System.Nullable`1[System.Int64]).Call $reader.ReadInt16()), + .Default(System.DateTime)) + } .Else { + .If ($fieldType == .Constant(BT_INT8)) { + ($Example_result._dt2).value = (System.Nullable`1[System.DateTime]).Call ExpressionsTest.BondTypeAliasConverter.Convert( + (System.Int64)((System.Nullable`1[System.Int64]).Call $reader.ReadInt8()), + .Default(System.DateTime)) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT64), + $fieldType) + } + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(0)) { + .Block() { + .Default(System.Void); + .Break end { } + } + } .Else { + .Call $reader.Skip($fieldType) + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(0)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } } .Else { - .If ($fieldType == .Constant(BT_INT8)) { - ($Example_result._dt2).value = (System.Nullable`1[System.DateTime]).Call ExpressionsTest.BondTypeAliasConverter.Convert( - (System.Int64)((System.Nullable`1[System.Int64]).Call $reader.ReadInt8()), - .Default(System.DateTime)) - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT64), - $fieldType) + .Block() { + .Default(System.Void); + .Break end { } } } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(0)) { - .Block() { - .Default(System.Void); - .Break end { } + .LabelTarget end:; + .Loop { + .If ($fieldType != .Constant(BT_STOP)) { + .Block() { + .If ($fieldType == .Constant(BT_STOP_BASE)) { + .Default(System.Void) + } .Else { + .Block() { + .Call $reader.Skip($fieldType); + .Call $reader.ReadFieldEnd() + } + }; + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $reader.ReadStructEnd(); + .Default(System.Void) } - } .Else { - .Call $reader.Skip($fieldType) } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(0)) { - .Break end { } - } .Else { - .Default(System.Void) + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ($fieldType != .Constant(BT_STOP)) { - .Block() { - .If ($fieldType == .Constant(BT_STOP_BASE)) { - .Default(System.Void) - } .Else { - .Block() { - .Call $reader.Skip($fieldType); - .Call $reader.ReadFieldEnd() - } - }; - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId) - } - } .Else { - .Break end { } } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_STRUCT), + $fieldType) + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(86)) { + .Block() { + .Default(System.Void); + .Break end { } } - .LabelTarget end:; - .Call $reader.ReadStructEnd(); - .Default(System.Void) + } .Else { + .Call $reader.Skip($fieldType) } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(86)) { + .Break end { } + } .Else { + .Default(System.Void) } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_STRUCT), - $fieldType) - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(86)) { + } + } .Else { .Block() { .Default(System.Void); .Break end { } } - } .Else { - .Call $reader.Skip($fieldType) } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(86)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Default(System.Void); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ($fieldType != .Constant(BT_STOP)) { - .Block() { - .If ($fieldType == .Constant(BT_STOP_BASE)) { - .Default(System.Void) - } .Else { - .Block() { - .Call $reader.Skip($fieldType); - .Call $reader.ReadFieldEnd() + .LabelTarget end:; + .Loop { + .If ($fieldType != .Constant(BT_STOP)) { + .Block() { + .If ($fieldType == .Constant(BT_STOP_BASE)) { + .Default(System.Void) + } .Else { + .Block() { + .Call $reader.Skip($fieldType); + .Call $reader.ReadFieldEnd() + } + }; + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId) + } + } .Else { + .Break end { } } - }; - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId) + } + .LabelTarget end:; + .Call $reader.ReadStructEnd(); + .Default(System.Void) } - } .Else { - .Break end { } } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - .LabelTarget end:; - .Call $reader.ReadStructEnd(); - .Default(System.Void) } }; (System.Object)$Example_result diff --git a/cs/test/expressions/DeserializeSP.expressions b/cs/test/expressions/DeserializeSP.expressions index 47a2823845..f9adb779be 100644 --- a/cs/test/expressions/DeserializeSP.expressions +++ b/cs/test/expressions/DeserializeSP.expressions @@ -3,734 +3,1124 @@ .Block(ExpressionsTest.Example $Example_result) { .Block() { $Example_result = .New ExpressionsTest.Example(); - .Block() { - .Default(System.Void); - .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { .Block() { - .Default(System.Void); - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block(System.Collections.Generic.List`1[System.UInt64] $Convert(Example_result).vvb_item) { - .Block(System.Int32 $Convert(Example_result).vvb_count) { - $Convert(Example_result).vvb_count = $count; - .If ($Convert(Example_result).vvb_count > 65536) { - $Convert(Example_result).vvb_count = 65536 - } .Else { - .Default(System.Void) - }; - (((ExpressionsTest.Base)$Example_result).vvb).Capacity = $Convert(Example_result).vvb_count - }; - .Loop { - .If ($count-- > 0) { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block() { + .Default(System.Void); + .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); .Block() { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block(System.UInt64 $Convert(Example_result).vvb_item_item) { - .Block(System.Int32 $Convert(Example_result).vvb_item_count) { - $Convert(Example_result).vvb_item_count = $count; - .If ($Convert(Example_result).vvb_item_count > 65536) { - $Convert(Example_result).vvb_item_count = 65536 - } .Else { - .Default(System.Void) - }; - $Convert(Example_result).vvb_item = .New System.Collections.Generic.List`1[System.UInt64]($Convert(Example_result).vvb_item_count) - }; - .Loop { - .If ($count-- > 0) { - .Block() { - $Convert(Example_result).vvb_item_item = .Call $reader.ReadUInt64(); - .Call $Convert(Example_result).vvb_item.Add($Convert(Example_result).vvb_item_item) + .Default(System.Void); + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block(System.Collections.Generic.List`1[System.UInt64] $Convert(Example_result).vvb_item) { + .Block(System.Int32 $Convert(Example_result).vvb_count) { + $Convert(Example_result).vvb_count = $count; + .If ($Convert(Example_result).vvb_count > 65536) { + $Convert(Example_result).vvb_count = 65536 + } .Else { + .Default(System.Void) + }; + (((ExpressionsTest.Base)$Example_result).vvb).Capacity = $Convert(Example_result).vvb_count + }; + .Loop { + .If ($count-- > 0) { + .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block(System.UInt64 $Convert(Example_result).vvb_item_item) { + .Block(System.Int32 $Convert(Example_result).vvb_item_count) { + $Convert(Example_result).vvb_item_count = $count; + .If ($Convert(Example_result).vvb_item_count > 65536) { + $Convert(Example_result).vvb_item_count = 65536 + } .Else { + .Default(System.Void) + }; + $Convert(Example_result).vvb_item = .New System.Collections.Generic.List`1[System.UInt64]($Convert(Example_result).vvb_item_count) + }; + .Loop { + .If ($count-- > 0) { + .Block() { + $Convert(Example_result).vvb_item_item = .Call $reader.ReadUInt64(); + .Call $Convert(Example_result).vvb_item.Add($Convert(Example_result).vvb_item_item) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Default(System.Void) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call (((ExpressionsTest.Base)$Example_result).vvb).Add($Convert(Example_result).vvb_item) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Default(System.Void) + }; + .Call $reader.ReadContainerEnd() } - } .Else { - .Break end { } } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - .LabelTarget end:; - .Default(System.Void) - }; - .Call $reader.ReadContainerEnd() + } }; - .Call (((ExpressionsTest.Base)$Example_result).vvb).Add($Convert(Example_result).vvb_item) + .Default(System.Void) } - } .Else { - .Break end { } } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - .LabelTarget end:; - .Default(System.Void) - }; - .Call $reader.ReadContainerEnd() - } - }; - .Default(System.Void) - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - $Example_result._bool = .Call $reader.ReadBool() - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - $Example_result._str = .Call $reader.ReadString() - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - $Example_result._uint32 = .Call $reader.ReadUInt32() - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - $Example_result._int8 = .Call $reader.ReadInt8() - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Invoke (.Lambda #Lambda2)( - "Example", - "_int64") - } .Else { - $Example_result._int64 = .Call $reader.ReadInt64() - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - $Example_result._double = .Call $reader.ReadDouble() - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - .Block() { - .Block() { - .Default(System.Void); + } + }; .If ( .Call $reader.ReadFieldOmitted() ) { .Default(System.Void) } .Else { - ($Example_result.guid).Data1 = .Call $reader.ReadUInt32() + $Example_result._bool = .Call $reader.ReadBool() }; .If ( .Call $reader.ReadFieldOmitted() ) { .Default(System.Void) } .Else { - ($Example_result.guid).Data2 = .Call $reader.ReadUInt16() + $Example_result._str = .Call $reader.ReadString() }; .If ( .Call $reader.ReadFieldOmitted() ) { .Default(System.Void) } .Else { - ($Example_result.guid).Data3 = .Call $reader.ReadUInt16() + $Example_result._uint32 = .Call $reader.ReadUInt32() }; .If ( .Call $reader.ReadFieldOmitted() ) { .Default(System.Void) } .Else { - ($Example_result.guid).Data4 = .Call $reader.ReadUInt64() + $Example_result._int8 = .Call $reader.ReadInt8() }; - .Default(System.Void) - } - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block(System.Int32 $Example_result._int32Vector_item) { - .Block(System.Int32 $Example_result._int32Vector_count) { - $Example_result._int32Vector_count = $count; - .If ($Example_result._int32Vector_count > 65536) { - $Example_result._int32Vector_count = 65536 - } .Else { - .Default(System.Void) - }; - ($Example_result._int32Vector).Capacity = $Example_result._int32Vector_count + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Invoke (.Lambda #Lambda2)( + "Example", + "_int64") + } .Else { + $Example_result._int64 = .Call $reader.ReadInt64() + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + $Example_result._double = .Call $reader.ReadDouble() }; - .Loop { - .If ($count-- > 0) { - .Block() { - $Example_result._int32Vector_item = .Call $reader.ReadInt32(); - .Call ($Example_result._int32Vector).Add($Example_result._int32Vector_item) + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block() { + .Default(System.Void); + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + ($Example_result.guid).Data1 = .Call $reader.ReadUInt32() + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + ($Example_result.guid).Data2 = .Call $reader.ReadUInt16() + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + ($Example_result.guid).Data3 = .Call $reader.ReadUInt16() + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + ($Example_result.guid).Data4 = .Call $reader.ReadUInt64() + }; + .Default(System.Void) + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } } - } .Else { - .Break end { } } - } - .LabelTarget end:; - .Default(System.Void) - }; - .Call $reader.ReadContainerEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block(ExpressionsTest.Nested $Example_result._nestedVector_item) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { - .Block() { + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { .Block() { - $Example_result._nestedVector_item = .New ExpressionsTest.Nested(); - .Block() { - .Default(System.Void); - .If ( - .Call $reader.ReadFieldOmitted() - ) { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block(System.Int32 $Example_result._int32Vector_item) { + .Block(System.Int32 $Example_result._int32Vector_count) { + $Example_result._int32Vector_count = $count; + .If ($Example_result._int32Vector_count > 65536) { + $Example_result._int32Vector_count = 65536 + } .Else { + .Default(System.Void) + }; + ($Example_result._int32Vector).Capacity = $Example_result._int32Vector_count + }; + .Loop { + .If ($count-- > 0) { + .Block() { + $Example_result._int32Vector_item = .Call $reader.ReadInt32(); + .Call ($Example_result._int32Vector).Add($Example_result._int32Vector_item) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; .Default(System.Void) - } .Else { - $Example_result._nestedVector_item._double = .Call $reader.ReadDouble() }; - .Default(System.Void) + .Call $reader.ReadContainerEnd() } - }; - .Call ($Example_result._nestedVector).Add($Example_result._nestedVector_item) + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - } .Else { - .Break end { } } - } - .LabelTarget end:; - .Default(System.Void) - }; - .Call $reader.ReadContainerEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - $Example_result.b = .Call $reader.ReadBytes($count); - .Call $reader.ReadContainerEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block(System.ArraySegment`1[System.Byte] $Example_result._blobList_item) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { - .Block() { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - $Example_result._blobList_item = .Call $reader.ReadBytes($count); - .Call $reader.ReadContainerEnd() - }; - .Call ($Example_result._blobList).Add($Example_result._blobList_item) + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block(ExpressionsTest.Nested $Example_result._nestedVector_item) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { + .Block() { + .Block() { + $Example_result._nestedVector_item = .New ExpressionsTest.Nested(); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block() { + .Default(System.Void); + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + $Example_result._nestedVector_item._double = .Call $reader.ReadDouble() + }; + .Default(System.Void) + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + } + }; + .Call ($Example_result._nestedVector).Add($Example_result._nestedVector_item) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Default(System.Void) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - } .Else { - .Break end { } } - } - .LabelTarget end:; - .Default(System.Void) - }; - .Call $reader.ReadContainerEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block(System.ArraySegment`1[System.Byte] $Example_result._blobVector_item) { - .Block(System.Int32 $Example_result._blobVector_count) { - $Example_result._blobVector_count = $count; - .If ($Example_result._blobVector_count > 65536) { - $Example_result._blobVector_count = 65536 - } .Else { - .Default(System.Void) - }; - ($Example_result._blobVector).Capacity = $Example_result._blobVector_count }; - .Loop { - .If ($count-- > 0) { - .Block() { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - $Example_result._blobVector_item = .Call $reader.ReadBytes($count); - .Call $reader.ReadContainerEnd() - }; - .Call ($Example_result._blobVector).Add($Example_result._blobVector_item) + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + $Example_result.b = .Call $reader.ReadBytes($count); + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - } .Else { - .Break end { } } - } - .LabelTarget end:; - .Default(System.Void) - }; - .Call $reader.ReadContainerEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block( - System.Int32 $Example_result._blobMap_key, - System.ArraySegment`1[System.Byte] $Example_result._blobMap_value) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { - .Block() { - $Example_result._blobMap_key = .Call $reader.ReadInt32(); - .Default(System.Void); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - $Example_result._blobMap_value = .Call $reader.ReadBytes($count); - .Call $reader.ReadContainerEnd() - }; - ($Example_result._blobMap).Item[$Example_result._blobMap_key] = $Example_result._blobMap_value + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block(System.ArraySegment`1[System.Byte] $Example_result._blobList_item) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { + .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + $Example_result._blobList_item = .Call $reader.ReadBytes($count); + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call ($Example_result._blobList).Add($Example_result._blobList_item) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Default(System.Void) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - } .Else { - .Break end { } } - } - .LabelTarget end: - }; - .Call $reader.ReadContainerEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Loop { - .If ($count-- > 0) { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - $Example_result._blobNullable = .Call $reader.ReadBytes($count); - .Call $reader.ReadContainerEnd() + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block(System.ArraySegment`1[System.Byte] $Example_result._blobVector_item) { + .Block(System.Int32 $Example_result._blobVector_count) { + $Example_result._blobVector_count = $count; + .If ($Example_result._blobVector_count > 65536) { + $Example_result._blobVector_count = 65536 + } .Else { + .Default(System.Void) + }; + ($Example_result._blobVector).Capacity = $Example_result._blobVector_count + }; + .Loop { + .If ($count-- > 0) { + .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + $Example_result._blobVector_item = .Call $reader.ReadBytes($count); + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call ($Example_result._blobVector).Add($Example_result._blobVector_item) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Default(System.Void) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - } .Else { - .Break end { } } - } - .LabelTarget end: - }; - .Call $reader.ReadContainerEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block( - System.Int32 $Example_result._map_key, - System.Double $Example_result._map_value) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { - .Block() { - $Example_result._map_key = .Call $reader.ReadInt32(); - .Default(System.Void); - $Example_result._map_value = .Call $reader.ReadDouble(); - ($Example_result._map).Item[$Example_result._map_key] = $Example_result._map_value + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block( + System.Int32 $Example_result._blobMap_key, + System.ArraySegment`1[System.Byte] $Example_result._blobMap_value) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { + .Block() { + $Example_result._blobMap_key = .Call $reader.ReadInt32(); + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + $Example_result._blobMap_value = .Call $reader.ReadBytes($count); + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + ($Example_result._blobMap).Item[$Example_result._blobMap_key] = $Example_result._blobMap_value + } + } .Else { + .Break end { } + } + } + .LabelTarget end: + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - } .Else { - .Break end { } } - } - .LabelTarget end: - }; - .Call $reader.ReadContainerEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - $Example_result._decimal = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(System.Decimal)); - .Call $reader.ReadContainerEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block(System.Decimal $Example_result._decList_item) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { - .Block() { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - $Example_result._decList_item = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(System.Decimal)); - .Call $reader.ReadContainerEnd() - }; - .Call ($Example_result._decList).Add($Example_result._decList_item) + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Loop { + .If ($count-- > 0) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + $Example_result._blobNullable = .Call $reader.ReadBytes($count); + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + } + } .Else { + .Break end { } + } + } + .LabelTarget end: + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - } .Else { - .Break end { } } - } - .LabelTarget end:; - .Default(System.Void) - }; - .Call $reader.ReadContainerEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block(System.Decimal $Example_result._decVector_item) { - .Block(System.Int32 $Example_result._decVector_count) { - $Example_result._decVector_count = $count; - .If ($Example_result._decVector_count > 65536) { - $Example_result._decVector_count = 65536 - } .Else { - .Default(System.Void) - }; - ($Example_result._decVector).Capacity = $Example_result._decVector_count }; - .Loop { - .If ($count-- > 0) { - .Block() { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - $Example_result._decVector_item = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(System.Decimal)); - .Call $reader.ReadContainerEnd() - }; - .Call ($Example_result._decVector).Add($Example_result._decVector_item) + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block( + System.Int32 $Example_result._map_key, + System.Double $Example_result._map_value) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { + .Block() { + $Example_result._map_key = .Call $reader.ReadInt32(); + .Default(System.Void); + $Example_result._map_value = .Call $reader.ReadDouble(); + ($Example_result._map).Item[$Example_result._map_key] = $Example_result._map_value + } + } .Else { + .Break end { } + } + } + .LabelTarget end: + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - } .Else { - .Break end { } } - } - .LabelTarget end:; - .Default(System.Void) - }; - .Call $reader.ReadContainerEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block( - System.Int32 $Example_result._decMap_key, - System.Decimal $Example_result._decMap_value) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { - .Block() { - $Example_result._decMap_key = .Call $reader.ReadInt32(); - .Default(System.Void); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - $Example_result._decMap_value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(System.Decimal)); - .Call $reader.ReadContainerEnd() - }; - ($Example_result._decMap).Item[$Example_result._decMap_key] = $Example_result._decMap_value + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + $Example_result._decimal = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(System.Decimal)); + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - } .Else { - .Break end { } } - } - .LabelTarget end: - }; - .Call $reader.ReadContainerEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Loop { - .If ($count-- > 0) { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - $Example_result._decNullable = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(System.Decimal)); - .Call $reader.ReadContainerEnd() + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block(System.Decimal $Example_result._decList_item) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { + .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + $Example_result._decList_item = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(System.Decimal)); + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call ($Example_result._decList).Add($Example_result._decList_item) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Default(System.Void) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - } .Else { - .Break end { } } - } - .LabelTarget end: - }; - .Call $reader.ReadContainerEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Invoke (.Lambda #Lambda2)( - "Example", - "_decimal_req") - } .Else { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - $Example_result._decimal_req = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(System.Decimal)); - .Call $reader.ReadContainerEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - $Example_result._reference = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(ExpressionsTest.RefObject)); - .Call $reader.ReadContainerEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block(ExpressionsTest.RefObject $Example_result._refList_item) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { - .Block() { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - $Example_result._refList_item = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(ExpressionsTest.RefObject)); - .Call $reader.ReadContainerEnd() - }; - .Call ($Example_result._refList).Add($Example_result._refList_item) + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block(System.Decimal $Example_result._decVector_item) { + .Block(System.Int32 $Example_result._decVector_count) { + $Example_result._decVector_count = $count; + .If ($Example_result._decVector_count > 65536) { + $Example_result._decVector_count = 65536 + } .Else { + .Default(System.Void) + }; + ($Example_result._decVector).Capacity = $Example_result._decVector_count + }; + .Loop { + .If ($count-- > 0) { + .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + $Example_result._decVector_item = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(System.Decimal)); + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call ($Example_result._decVector).Add($Example_result._decVector_item) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Default(System.Void) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - } .Else { - .Break end { } } - } - .LabelTarget end:; - .Default(System.Void) - }; - .Call $reader.ReadContainerEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block(ExpressionsTest.RefObject $Example_result._refVector_item) { - .Block(System.Int32 $Example_result._refVector_count) { - $Example_result._refVector_count = $count; - .If ($Example_result._refVector_count > 65536) { - $Example_result._refVector_count = 65536 - } .Else { - .Default(System.Void) - }; - ($Example_result._refVector).Capacity = $Example_result._refVector_count }; - .Loop { - .If ($count-- > 0) { - .Block() { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - $Example_result._refVector_item = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(ExpressionsTest.RefObject)); - .Call $reader.ReadContainerEnd() - }; - .Call ($Example_result._refVector).Add($Example_result._refVector_item) + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block( + System.Int32 $Example_result._decMap_key, + System.Decimal $Example_result._decMap_value) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { + .Block() { + $Example_result._decMap_key = .Call $reader.ReadInt32(); + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + $Example_result._decMap_value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(System.Decimal)); + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + ($Example_result._decMap).Item[$Example_result._decMap_key] = $Example_result._decMap_value + } + } .Else { + .Break end { } + } + } + .LabelTarget end: + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - } .Else { - .Break end { } } - } - .LabelTarget end:; - .Default(System.Void) - }; - .Call $reader.ReadContainerEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block( - System.Int32 $Example_result._refMap_key, - ExpressionsTest.RefObject $Example_result._refMap_value) { - .Default(System.Void); - .Loop { - .If ($count-- > 0) { - .Block() { - $Example_result._refMap_key = .Call $reader.ReadInt32(); - .Default(System.Void); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - $Example_result._refMap_value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(ExpressionsTest.RefObject)); - .Call $reader.ReadContainerEnd() - }; - ($Example_result._refMap).Item[$Example_result._refMap_key] = $Example_result._refMap_value + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Loop { + .If ($count-- > 0) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + $Example_result._decNullable = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(System.Decimal)); + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + } + } .Else { + .Break end { } + } + } + .LabelTarget end: + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - } .Else { - .Break end { } } - } - .LabelTarget end: - }; - .Call $reader.ReadContainerEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - $Example_result._refNullable = .Default(ExpressionsTest.RefObject); - .Loop { - .If ($count-- > 0) { - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - $Example_result._refNullable = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadBytes($count), - .Default(ExpressionsTest.RefObject)); - .Call $reader.ReadContainerEnd() + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Invoke (.Lambda #Lambda2)( + "Example", + "_decimal_req") + } .Else { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + $Example_result._decimal_req = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(System.Decimal)); + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - } .Else { - .Break end { } } - } - .LabelTarget end: - }; - .Call $reader.ReadContainerEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - .Block() { - .Block() { - .Default(System.Void); + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + $Example_result._reference = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(ExpressionsTest.RefObject)); + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + } + }; .If ( .Call $reader.ReadFieldOmitted() ) { .Default(System.Void) } .Else { - ($Example_result._dt).value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( - .Call $reader.ReadInt64(), - .Default(System.DateTime)) + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block(ExpressionsTest.RefObject $Example_result._refList_item) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { + .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + $Example_result._refList_item = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(ExpressionsTest.RefObject)); + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call ($Example_result._refList).Add($Example_result._refList_item) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Default(System.Void) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block(ExpressionsTest.RefObject $Example_result._refVector_item) { + .Block(System.Int32 $Example_result._refVector_count) { + $Example_result._refVector_count = $count; + .If ($Example_result._refVector_count > 65536) { + $Example_result._refVector_count = 65536 + } .Else { + .Default(System.Void) + }; + ($Example_result._refVector).Capacity = $Example_result._refVector_count + }; + .Loop { + .If ($count-- > 0) { + .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + $Example_result._refVector_item = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(ExpressionsTest.RefObject)); + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call ($Example_result._refVector).Add($Example_result._refVector_item) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Default(System.Void) + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block( + System.Int32 $Example_result._refMap_key, + ExpressionsTest.RefObject $Example_result._refMap_value) { + .Default(System.Void); + .Loop { + .If ($count-- > 0) { + .Block() { + $Example_result._refMap_key = .Call $reader.ReadInt32(); + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + $Example_result._refMap_value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(ExpressionsTest.RefObject)); + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + ($Example_result._refMap).Item[$Example_result._refMap_key] = $Example_result._refMap_value + } + } .Else { + .Break end { } + } + } + .LabelTarget end: + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + $Example_result._refNullable = .Default(ExpressionsTest.RefObject); + .Loop { + .If ($count-- > 0) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + $Example_result._refNullable = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadBytes($count), + .Default(ExpressionsTest.RefObject)); + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + } + } .Else { + .Break end { } + } + } + .LabelTarget end: + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + } }; - .Default(System.Void) - } - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Default(System.Void) - } .Else { - .Block() { - .Block() { - .Default(System.Void); .If ( .Call $reader.ReadFieldOmitted() ) { .Default(System.Void) } .Else { - ($Example_result._dt2).value = (System.Nullable`1[System.DateTime]).Call ExpressionsTest.BondTypeAliasConverter.Convert( - (System.Int64)((System.Nullable`1[System.Int64]).Call $reader.ReadInt64()), - .Default(System.DateTime)) + .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block() { + .Default(System.Void); + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + ($Example_result._dt).value = .Call ExpressionsTest.BondTypeAliasConverter.Convert( + .Call $reader.ReadInt64(), + .Default(System.DateTime)) + }; + .Default(System.Void) + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + } + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block() { + .Default(System.Void); + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Default(System.Void) + } .Else { + ($Example_result._dt2).value = (System.Nullable`1[System.DateTime]).Call ExpressionsTest.BondTypeAliasConverter.Convert( + (System.Int64)((System.Nullable`1[System.Int64]).Call $reader.ReadInt64()), + .Default(System.DateTime)) + }; + .Default(System.Void) + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + } + } }; .Default(System.Void) } } - }; - .Default(System.Void) + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } } }; (System.Object)$Example_result diff --git a/cs/test/expressions/TranscodeCBCB.expressions b/cs/test/expressions/TranscodeCBCB.expressions index 2c407ac7cb..ccd6c10365 100644 --- a/cs/test/expressions/TranscodeCBCB.expressions +++ b/cs/test/expressions/TranscodeCBCB.expressions @@ -1,89 +1,99 @@ .Lambda #Lambda1( Bond.Protocols.CompactBinaryReader`1[Bond.IO.Unsafe.InputStream] $reader, Bond.Protocols.CompactBinaryWriter`1[Bond.IO.Unsafe.OutputStream] $writer) { - .Block( - Bond.BondDataType $fieldType, - System.UInt16 $fieldId) { - .Call $reader.ReadStructBegin(); - .Call $writer.WriteStructBegin(null); - .Default(System.Void); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Loop { - .If ($fieldType != .Constant(BT_STOP)) { - .Block() { - .If ($fieldType == .Constant(BT_STOP_BASE)) { - .Call $writer.WriteBaseEnd() - } .Else { - .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + Bond.BondDataType $fieldType, + System.UInt16 $fieldId) { + .Call $reader.ReadStructBegin(); + .Call $writer.WriteStructBegin(null); + .Default(System.Void); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Loop { + .If ($fieldType != .Constant(BT_STOP)) { .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 1) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 2) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 0) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) + .If ($fieldType == .Constant(BT_STOP_BASE)) { + .Call $writer.WriteBaseEnd() + } .Else { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 1) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 2) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 0) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd() + } }; - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd() + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId) + } + } .Else { + .Break end { } } - }; - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId) + } + .LabelTarget end:; + .Call $reader.ReadStructEnd(); + .Call $writer.WriteStructEnd() } - } .Else { - .Break end { } } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - .LabelTarget end:; - .Call $reader.ReadStructEnd(); - .Call $writer.WriteStructEnd() } } @@ -101,84 +111,94 @@ }.Lambda #Lambda1( Bond.Protocols.CompactBinaryReader`1[Bond.IO.Unsafe.InputStream] $reader, Bond.Protocols.CompactBinaryWriter`1[Bond.IO.Unsafe.OutputStream] $writer) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_UINT8)) { - .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)) - } .Else { - .If ($elementType == .Constant(BT_INT8)) { - .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)) - } .Else { - .Loop { - .If ($count-- > 0) { - .Block() { - .Default(System.Void); - .Switch ($elementType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 1) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 2) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 0) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($elementType) - }; - .Default(System.Void) - } + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_UINT8)) { + .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)) } .Else { - .Break end { } - } - } - .LabelTarget end: + .If ($elementType == .Constant(BT_INT8)) { + .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)) + } .Else { + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Switch ($elementType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 1) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 2) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 0) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($elementType) + }; + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end: + } + }; + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() } - }; - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } } } @@ -196,128 +216,138 @@ }.Lambda #Lambda1( Bond.Protocols.CompactBinaryReader`1[Bond.IO.Unsafe.InputStream] $reader, Bond.Protocols.CompactBinaryWriter`1[Bond.IO.Unsafe.OutputStream] $writer) { - .Block( - System.Int32 $count, - Bond.BondDataType $keyType, - Bond.BondDataType $valueType) { - .Call $reader.ReadContainerBegin( - $count, - $keyType, - $valueType); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - $keyType, - $valueType); - .Loop { - .If ($count-- > 0) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $keyType, + Bond.BondDataType $valueType) { + .Call $reader.ReadContainerBegin( + $count, + $keyType, + $valueType); .Block() { - .Default(System.Void); - .Switch ($keyType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 1) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 2) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 0) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($keyType) - }; - .Default(System.Void); - .Default(System.Void); - .Default(System.Void); - .Switch ($valueType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 1) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 2) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 0) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($valueType) - }; - .Default(System.Void) - } - } .Else { - .Break end { } + .Call $writer.WriteContainerBegin( + $count, + $keyType, + $valueType); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Switch ($keyType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 1) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 2) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 0) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($keyType) + }; + .Default(System.Void); + .Default(System.Void); + .Default(System.Void); + .Switch ($valueType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 1) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 2) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 0) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($valueType) + }; + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() } } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } } } diff --git a/cs/test/expressions/TranscodeCBSP.expressions b/cs/test/expressions/TranscodeCBSP.expressions index 64c5f22829..2475d2dc51 100644 --- a/cs/test/expressions/TranscodeCBSP.expressions +++ b/cs/test/expressions/TranscodeCBSP.expressions @@ -1,233 +1,322 @@ .Lambda #Lambda1( Bond.Protocols.CompactBinaryReader`1[Bond.IO.Unsafe.InputStream] $reader, Bond.Protocols.SimpleBinaryWriter`1[Bond.IO.Unsafe.OutputStream] $writer) { - .Block( - Bond.BondDataType $fieldType, - System.UInt16 $fieldId) { - .Call $reader.ReadStructBegin(); - .Call $writer.WriteStructBegin(.Constant(Example)); - .Block( - Bond.BondDataType $fieldType, - System.UInt16 $fieldId) { - .Call $reader.ReadBaseBegin(); - .Call $writer.WriteBaseBegin(.Constant(Base)); - .Default(System.Void); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(0)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + Bond.BondDataType $fieldType, + System.UInt16 $fieldId) { + .Call $reader.ReadStructBegin(); + .Call $writer.WriteStructBegin(.Constant(Example)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { .Block() { - .Block() { - .Call $writer.WriteFieldBegin( + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + Bond.BondDataType $fieldType, + System.UInt16 $fieldId) { + .Call $reader.ReadBaseBegin(); + .Call $writer.WriteBaseBegin(.Constant(Base)); + .Default(System.Void); + .Call $reader.ReadFieldBegin( $fieldType, - .Constant(0), - .Constant(vvb)); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 1); - .Call $writer.WriteFieldEnd() + $fieldId); + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(0)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(0), + .Constant(vvb)); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 1); + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(0)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(0), + .Constant(vvb)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(0)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(0), + .Constant(vvb)); + .Break end { } + } + } + } + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldType == .Constant(BT_STOP_BASE)) { + .Call $writer.WriteBaseEnd() + } .Else { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd() + } + }; + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $reader.ReadBaseEnd(); + .Call $writer.WriteBaseEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Loop { + .If ((System.Int32)$fieldType > 1) { + .Block() { + .If ($fieldId == .Constant(0)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(0), + .Constant(_bool)); + .If ($fieldType == .Constant(BT_BOOL)) { + .Call $writer.WriteBool(.Call $reader.ReadBool()) + } .Else { + .Invoke (.Lambda #Lambda4)( + .Constant(BT_BOOL), + $fieldType) + }; + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(0)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_BOOL), + .Constant(0), + .Constant(_bool)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } }; .Call $reader.ReadFieldEnd(); .Call $reader.ReadFieldBegin( $fieldType, $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(0)) { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(0), - .Constant(vvb)); + .If ($fieldId > .Constant(0)) { .Break end { } - } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() + } .Else { + .Default(System.Void) } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(0)) { - .Break end { } - } .Else { - .Default(System.Void) - } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(0), - .Constant(vvb)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldType == .Constant(BT_STOP_BASE)) { - .Call $writer.WriteBaseEnd() } .Else { - .Block() { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd() - } - }; - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $reader.ReadBaseEnd(); - .Call $writer.WriteBaseEnd() - }; - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(0)) { - .Block() { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - .Constant(0), - .Constant(_bool)); - .If ($fieldType == .Constant(BT_BOOL)) { - .Call $writer.WriteBool(.Call $reader.ReadBool()) - } .Else { - .Invoke (.Lambda #Lambda4)( - .Constant(BT_BOOL), - $fieldType) - }; - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(0)) { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_BOOL), @@ -235,110 +324,110 @@ .Constant(_bool)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(0)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_BOOL), - .Constant(0), - .Constant(_bool)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(2)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - .Constant(2), - .Constant(_str)); - .If ($fieldType == .Constant(BT_STRING)) { - .Call $writer.WriteString(.Call $reader.ReadString()) + .If ($fieldId == .Constant(2)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(2), + .Constant(_str)); + .If ($fieldType == .Constant(BT_STRING)) { + .Call $writer.WriteString(.Call $reader.ReadString()) + } .Else { + .Invoke (.Lambda #Lambda4)( + .Constant(BT_STRING), + $fieldType) + }; + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } } .Else { - .Invoke (.Lambda #Lambda4)( - .Constant(BT_STRING), - $fieldType) + .If ($fieldId > .Constant(2)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_STRING), + .Constant(2), + .Constant(_str)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } }; - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(2)) { + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(2)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_STRING), @@ -346,118 +435,118 @@ .Constant(_str)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(2)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_STRING), - .Constant(2), - .Constant(_str)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(12)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - .Constant(12), - .Constant(_uint32)); - .If ($fieldType == .Constant(BT_UINT32)) { - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .If ($fieldId == .Constant(12)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(12), + .Constant(_uint32)); + .If ($fieldType == .Constant(BT_UINT32)) { + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + } .Else { + .If ($fieldType == .Constant(BT_UINT16)) { + .Call $writer.WriteUInt32((System.UInt32).Call $reader.ReadUInt16()) + } .Else { + .If ($fieldType == .Constant(BT_UINT8)) { + .Call $writer.WriteUInt32((System.UInt32).Call $reader.ReadUInt8()) + } .Else { + .Invoke (.Lambda #Lambda4)( + .Constant(BT_UINT32), + $fieldType) + } + } + }; + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } } .Else { - .If ($fieldType == .Constant(BT_UINT16)) { - .Call $writer.WriteUInt32((System.UInt32).Call $reader.ReadUInt16()) - } .Else { - .If ($fieldType == .Constant(BT_UINT8)) { - .Call $writer.WriteUInt32((System.UInt32).Call $reader.ReadUInt8()) - } .Else { - .Invoke (.Lambda #Lambda4)( + .If ($fieldId > .Constant(12)) { + .Block() { + .Call $writer.WriteFieldOmitted( .Constant(BT_UINT32), - $fieldType) + .Constant(12), + .Constant(_uint32)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() } } }; - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(12)) { + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(12)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_UINT32), @@ -465,110 +554,110 @@ .Constant(_uint32)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(12)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_UINT32), - .Constant(12), - .Constant(_uint32)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(14)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - .Constant(14), - .Constant(_int8)); - .If ($fieldType == .Constant(BT_INT8)) { - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .If ($fieldId == .Constant(14)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(14), + .Constant(_int8)); + .If ($fieldType == .Constant(BT_INT8)) { + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + } .Else { + .Invoke (.Lambda #Lambda4)( + .Constant(BT_INT8), + $fieldType) + }; + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } } .Else { - .Invoke (.Lambda #Lambda4)( - .Constant(BT_INT8), - $fieldType) + .If ($fieldId > .Constant(14)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_INT8), + .Constant(14), + .Constant(_int8)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } }; - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(14)) { + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(14)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_INT8), @@ -576,122 +665,122 @@ .Constant(_int8)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(14)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_INT8), - .Constant(14), - .Constant(_int8)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(17)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - .Constant(17), - .Constant(_int64)); - .If ($fieldType == .Constant(BT_INT64)) { - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .If ($fieldId == .Constant(17)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(17), + .Constant(_int64)); + .If ($fieldType == .Constant(BT_INT64)) { + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + } .Else { + .If ($fieldType == .Constant(BT_INT32)) { + .Call $writer.WriteInt64((System.Int64).Call $reader.ReadInt32()) + } .Else { + .If ($fieldType == .Constant(BT_INT16)) { + .Call $writer.WriteInt64((System.Int64).Call $reader.ReadInt16()) + } .Else { + .If ($fieldType == .Constant(BT_INT8)) { + .Call $writer.WriteInt64((System.Int64).Call $reader.ReadInt8()) + } .Else { + .Invoke (.Lambda #Lambda4)( + .Constant(BT_INT64), + $fieldType) + } + } + } + }; + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } } .Else { - .If ($fieldType == .Constant(BT_INT32)) { - .Call $writer.WriteInt64((System.Int64).Call $reader.ReadInt32()) + .If ($fieldId > .Constant(17)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_INT64), + .Constant(17), + .Constant(_int64)); + .Break end { } + } } .Else { - .If ($fieldType == .Constant(BT_INT16)) { - .Call $writer.WriteInt64((System.Int64).Call $reader.ReadInt16()) - } .Else { - .If ($fieldType == .Constant(BT_INT8)) { - .Call $writer.WriteInt64((System.Int64).Call $reader.ReadInt8()) - } .Else { - .Invoke (.Lambda #Lambda4)( - .Constant(BT_INT64), - $fieldType) - } + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() } } }; - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(17)) { + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(17)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_INT64), @@ -699,114 +788,114 @@ .Constant(_int64)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(17)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_INT64), - .Constant(17), - .Constant(_int64)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(18)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - .Constant(18), - .Constant(_double)); - .If ($fieldType == .Constant(BT_DOUBLE)) { - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .If ($fieldId == .Constant(18)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(18), + .Constant(_double)); + .If ($fieldType == .Constant(BT_DOUBLE)) { + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + } .Else { + .If ($fieldType == .Constant(BT_FLOAT)) { + .Call $writer.WriteDouble((System.Double).Call $reader.ReadFloat()) + } .Else { + .Invoke (.Lambda #Lambda4)( + .Constant(BT_DOUBLE), + $fieldType) + } + }; + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } } .Else { - .If ($fieldType == .Constant(BT_FLOAT)) { - .Call $writer.WriteDouble((System.Double).Call $reader.ReadFloat()) + .If ($fieldId > .Constant(18)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_DOUBLE), + .Constant(18), + .Constant(_double)); + .Break end { } + } } .Else { - .Invoke (.Lambda #Lambda4)( - .Constant(BT_DOUBLE), - $fieldType) + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } } }; - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(18)) { + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(18)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_DOUBLE), @@ -814,107 +903,107 @@ .Constant(_double)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(18)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_DOUBLE), - .Constant(18), - .Constant(_double)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(20)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( + .If ($fieldId == .Constant(20)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(20), + .Constant(guid)); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 6); + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(20)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_STRUCT), + .Constant(20), + .Constant(guid)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( $fieldType, - .Constant(20), - .Constant(guid)); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 6); - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(20)) { + $fieldId); + .If ($fieldId > .Constant(20)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_STRUCT), @@ -922,107 +1011,107 @@ .Constant(guid)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(20)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_STRUCT), - .Constant(20), - .Constant(guid)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(30)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( + .If ($fieldId == .Constant(30)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(30), + .Constant(_int32Vector)); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 7); + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(30)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(30), + .Constant(_int32Vector)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( $fieldType, - .Constant(30), - .Constant(_int32Vector)); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 7); - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(30)) { + $fieldId); + .If ($fieldId > .Constant(30)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_LIST), @@ -1030,107 +1119,107 @@ .Constant(_int32Vector)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(30)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(30), - .Constant(_int32Vector)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(40)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( + .If ($fieldId == .Constant(40)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(40), + .Constant(_nestedVector)); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 8); + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(40)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(40), + .Constant(_nestedVector)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( $fieldType, - .Constant(40), - .Constant(_nestedVector)); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 8); - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(40)) { + $fieldId); + .If ($fieldId > .Constant(40)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_LIST), @@ -1138,107 +1227,107 @@ .Constant(_nestedVector)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(40)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(40), - .Constant(_nestedVector)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(50)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( + .If ($fieldId == .Constant(50)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(50), + .Constant(b)); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 10); + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(50)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(50), + .Constant(b)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( $fieldType, - .Constant(50), - .Constant(b)); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 10); - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(50)) { + $fieldId); + .If ($fieldId > .Constant(50)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_LIST), @@ -1246,215 +1335,215 @@ .Constant(b)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(50)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(50), - .Constant(b)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(51)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( + .If ($fieldId == .Constant(51)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(51), + .Constant(_blobList)); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 11); + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(51)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(51), + .Constant(_blobList)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( $fieldType, - .Constant(51), - .Constant(_blobList)); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 11); - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(51)) { + $fieldId); + .If ($fieldId > .Constant(51)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_LIST), .Constant(51), .Constant(_blobList)); .Break end { } - } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } - } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(51)) { - .Break end { } - } .Else { - .Default(System.Void) + } + } } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(51), - .Constant(_blobList)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(52)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( + .If ($fieldId == .Constant(52)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(52), + .Constant(_blobVector)); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 11); + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(52)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(52), + .Constant(_blobVector)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( $fieldType, - .Constant(52), - .Constant(_blobVector)); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 11); - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(52)) { + $fieldId); + .If ($fieldId > .Constant(52)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_LIST), @@ -1462,107 +1551,107 @@ .Constant(_blobVector)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(52)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(52), - .Constant(_blobVector)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(53)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( + .If ($fieldId == .Constant(53)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(53), + .Constant(_blobMap)); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 12); + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(53)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_MAP), + .Constant(53), + .Constant(_blobMap)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( $fieldType, - .Constant(53), - .Constant(_blobMap)); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 12); - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(53)) { + $fieldId); + .If ($fieldId > .Constant(53)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_MAP), @@ -1570,107 +1659,107 @@ .Constant(_blobMap)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(53)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_MAP), - .Constant(53), - .Constant(_blobMap)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(54)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( + .If ($fieldId == .Constant(54)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(54), + .Constant(_blobNullable)); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 11); + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(54)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(54), + .Constant(_blobNullable)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( $fieldType, - .Constant(54), - .Constant(_blobNullable)); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 11); - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(54)) { + $fieldId); + .If ($fieldId > .Constant(54)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_LIST), @@ -1678,107 +1767,107 @@ .Constant(_blobNullable)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(54)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(54), - .Constant(_blobNullable)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(60)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( + .If ($fieldId == .Constant(60)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(60), + .Constant(_map)); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 13); + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(60)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_MAP), + .Constant(60), + .Constant(_map)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( $fieldType, - .Constant(60), - .Constant(_map)); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 13); - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(60)) { + $fieldId); + .If ($fieldId > .Constant(60)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_MAP), @@ -1786,107 +1875,107 @@ .Constant(_map)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(60)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_MAP), - .Constant(60), - .Constant(_map)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(70)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( + .If ($fieldId == .Constant(70)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(70), + .Constant(_decimal)); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 10); + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(70)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(70), + .Constant(_decimal)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( $fieldType, - .Constant(70), - .Constant(_decimal)); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 10); - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(70)) { + $fieldId); + .If ($fieldId > .Constant(70)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_LIST), @@ -1894,107 +1983,107 @@ .Constant(_decimal)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(70)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(70), - .Constant(_decimal)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(71)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( + .If ($fieldId == .Constant(71)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(71), + .Constant(_decList)); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 11); + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(71)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(71), + .Constant(_decList)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( $fieldType, - .Constant(71), - .Constant(_decList)); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 11); - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(71)) { + $fieldId); + .If ($fieldId > .Constant(71)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_LIST), @@ -2002,107 +2091,107 @@ .Constant(_decList)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(71)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(71), - .Constant(_decList)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(72)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( + .If ($fieldId == .Constant(72)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(72), + .Constant(_decVector)); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 11); + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(72)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(72), + .Constant(_decVector)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( $fieldType, - .Constant(72), - .Constant(_decVector)); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 11); - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(72)) { + $fieldId); + .If ($fieldId > .Constant(72)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_LIST), @@ -2110,107 +2199,107 @@ .Constant(_decVector)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(72)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(72), - .Constant(_decVector)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(73)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( + .If ($fieldId == .Constant(73)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(73), + .Constant(_decMap)); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 12); + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(73)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_MAP), + .Constant(73), + .Constant(_decMap)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( $fieldType, - .Constant(73), - .Constant(_decMap)); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 12); - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(73)) { + $fieldId); + .If ($fieldId > .Constant(73)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_MAP), @@ -2218,107 +2307,107 @@ .Constant(_decMap)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(73)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_MAP), - .Constant(73), - .Constant(_decMap)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(74)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( + .If ($fieldId == .Constant(74)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(74), + .Constant(_decNullable)); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 11); + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(74)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(74), + .Constant(_decNullable)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( $fieldType, - .Constant(74), - .Constant(_decNullable)); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 11); - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(74)) { + $fieldId); + .If ($fieldId > .Constant(74)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_LIST), @@ -2326,107 +2415,107 @@ .Constant(_decNullable)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(74)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(74), - .Constant(_decNullable)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(75)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( + .If ($fieldId == .Constant(75)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(75), + .Constant(_decimal_req)); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 10); + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(75)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(75), + .Constant(_decimal_req)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( $fieldType, - .Constant(75), - .Constant(_decimal_req)); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 10); - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(75)) { + $fieldId); + .If ($fieldId > .Constant(75)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_LIST), @@ -2434,107 +2523,107 @@ .Constant(_decimal_req)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(75)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(75), - .Constant(_decimal_req)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(80)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( + .If ($fieldId == .Constant(80)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(80), + .Constant(_reference)); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 10); + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(80)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(80), + .Constant(_reference)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( $fieldType, - .Constant(80), - .Constant(_reference)); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 10); - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(80)) { + $fieldId); + .If ($fieldId > .Constant(80)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_LIST), @@ -2542,107 +2631,107 @@ .Constant(_reference)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(80)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(80), - .Constant(_reference)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(81)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( + .If ($fieldId == .Constant(81)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(81), + .Constant(_refList)); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 11); + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(81)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(81), + .Constant(_refList)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( $fieldType, - .Constant(81), - .Constant(_refList)); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 11); - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(81)) { + $fieldId); + .If ($fieldId > .Constant(81)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_LIST), @@ -2650,107 +2739,107 @@ .Constant(_refList)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(81)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(81), - .Constant(_refList)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(82)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( + .If ($fieldId == .Constant(82)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(82), + .Constant(_refVector)); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 11); + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(82)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(82), + .Constant(_refVector)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( $fieldType, - .Constant(82), - .Constant(_refVector)); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 11); - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(82)) { + $fieldId); + .If ($fieldId > .Constant(82)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_LIST), @@ -2758,215 +2847,215 @@ .Constant(_refVector)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(82)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(82), - .Constant(_refVector)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(83)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( + .If ($fieldId == .Constant(83)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(83), + .Constant(_refMap)); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 12); + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(83)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_MAP), + .Constant(83), + .Constant(_refMap)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( $fieldType, - .Constant(83), - .Constant(_refMap)); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 12); - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(83)) { + $fieldId); + .If ($fieldId > .Constant(83)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_MAP), .Constant(83), .Constant(_refMap)); - .Break end { } - } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() + .Break end { } } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(83)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_MAP), - .Constant(83), - .Constant(_refMap)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(84)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( + .If ($fieldId == .Constant(84)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(84), + .Constant(_refNullable)); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 11); + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(84)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(84), + .Constant(_refNullable)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( $fieldType, - .Constant(84), - .Constant(_refNullable)); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 11); - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(84)) { + $fieldId); + .If ($fieldId > .Constant(84)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_LIST), @@ -2974,107 +3063,107 @@ .Constant(_refNullable)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(84)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(84), - .Constant(_refNullable)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(85)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( + .If ($fieldId == .Constant(85)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(85), + .Constant(_dt)); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 14); + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(85)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_STRUCT), + .Constant(85), + .Constant(_dt)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( $fieldType, - .Constant(85), - .Constant(_dt)); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 14); - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(85)) { + $fieldId); + .If ($fieldId > .Constant(85)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_STRUCT), @@ -3082,107 +3171,107 @@ .Constant(_dt)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(85)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_STRUCT), - .Constant(85), - .Constant(_dt)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(86)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( + .If ($fieldId == .Constant(86)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(86), + .Constant(_dt2)); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 15); + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } + } .Else { + .If ($fieldId > .Constant(86)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_STRUCT), + .Constant(86), + .Constant(_dt2)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } + } + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( $fieldType, - .Constant(86), - .Constant(_dt2)); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 15); - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(86)) { + $fieldId); + .If ($fieldId > .Constant(86)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_STRUCT), @@ -3190,157 +3279,88 @@ .Constant(_dt2)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(86)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_STRUCT), - .Constant(86), - .Constant(_dt2)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ($fieldType != .Constant(BT_STOP)) { - .Block() { - .If ($fieldType == .Constant(BT_STOP_BASE)) { - .Call $writer.WriteBaseEnd() - } .Else { - .Block() { + .LabelTarget end:; + .Loop { + .If ($fieldType != .Constant(BT_STOP)) { .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) + .If ($fieldType == .Constant(BT_STOP_BASE)) { + .Call $writer.WriteBaseEnd() + } .Else { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd() + } }; - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd() + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId) + } + } .Else { + .Break end { } } - }; - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId) + } + .LabelTarget end:; + .Call $reader.ReadStructEnd(); + .Call $writer.WriteStructEnd() } - } .Else { - .Break end { } } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - .LabelTarget end:; - .Call $reader.ReadStructEnd(); - .Call $writer.WriteStructEnd() } } @@ -3366,40 +3386,50 @@ }.Lambda #Lambda1( Bond.Protocols.CompactBinaryReader`1[Bond.IO.Unsafe.InputStream] $reader, Bond.Protocols.SimpleBinaryWriter`1[Bond.IO.Unsafe.OutputStream] $writer) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_LIST)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_LIST)); - .Loop { - .If ($count-- > 0) { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_LIST)) { .Block() { - .Default(System.Void); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 2); - .Default(System.Void) + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_LIST)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 2); + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() } } .Else { - .Break end { } - } + .Invoke (.Lambda #Lambda3)( + .Constant(BT_LIST), + $elementType) + }; + .Call $reader.ReadContainerEnd() } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() } - } .Else { - .Invoke (.Lambda #Lambda3)( - .Constant(BT_LIST), - $elementType) - }; - .Call $reader.ReadContainerEnd() + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } } } @@ -3421,89 +3451,99 @@ }.Lambda #Lambda1( Bond.Protocols.CompactBinaryReader`1[Bond.IO.Unsafe.InputStream] $reader, Bond.Protocols.SimpleBinaryWriter`1[Bond.IO.Unsafe.OutputStream] $writer) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_UINT64)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_UINT64)); - .Loop { - .If ($count-- > 0) { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_UINT64)) { .Block() { - .Default(System.Void); - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()); - .Default(System.Void) + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_UINT64)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()); + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() } } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - } - } .Else { - .If ($elementType == .Constant(BT_UINT32)) { - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_UINT32)); - .Loop { - .If ($count-- > 0) { + .If ($elementType == .Constant(BT_UINT32)) { .Block() { - .Default(System.Void); - .Call $writer.WriteUInt64((System.UInt64).Call $reader.ReadUInt32()); - .Default(System.Void) + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_UINT32)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Call $writer.WriteUInt64((System.UInt64).Call $reader.ReadUInt32()); + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() } } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - } - } .Else { - .If ($elementType == .Constant(BT_UINT16)) { - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_UINT16)); - .Loop { - .If ($count-- > 0) { + .If ($elementType == .Constant(BT_UINT16)) { .Block() { - .Default(System.Void); - .Call $writer.WriteUInt64((System.UInt64).Call $reader.ReadUInt16()); - .Default(System.Void) + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_UINT16)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Call $writer.WriteUInt64((System.UInt64).Call $reader.ReadUInt16()); + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() } } .Else { - .Break end { } + .If ($elementType == .Constant(BT_UINT8)) { + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_UINT8)); + .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); + .Call $writer.WriteContainerEnd() + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_UINT64), + $elementType) + } } } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - } - } .Else { - .If ($elementType == .Constant(BT_UINT8)) { - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_UINT8)); - .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); - .Call $writer.WriteContainerEnd() - } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_UINT64), - $elementType) - } + }; + .Call $reader.ReadContainerEnd() } } - }; - .Call $reader.ReadContainerEnd() + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } } } @@ -3516,84 +3556,94 @@ }.Lambda #Lambda1( Bond.Protocols.CompactBinaryReader`1[Bond.IO.Unsafe.InputStream] $reader, Bond.Protocols.SimpleBinaryWriter`1[Bond.IO.Unsafe.OutputStream] $writer) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_UINT8)) { - .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)) - } .Else { - .If ($elementType == .Constant(BT_INT8)) { - .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)) - } .Else { - .Loop { - .If ($count-- > 0) { - .Block() { - .Default(System.Void); - .Switch ($elementType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($elementType) - }; - .Default(System.Void) - } + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_UINT8)) { + .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)) } .Else { - .Break end { } - } - } - .LabelTarget end: + .If ($elementType == .Constant(BT_INT8)) { + .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)) + } .Else { + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Switch ($elementType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($elementType) + }; + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end: + } + }; + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() } - }; - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } } } @@ -3611,128 +3661,138 @@ }.Lambda #Lambda1( Bond.Protocols.CompactBinaryReader`1[Bond.IO.Unsafe.InputStream] $reader, Bond.Protocols.SimpleBinaryWriter`1[Bond.IO.Unsafe.OutputStream] $writer) { - .Block( - System.Int32 $count, - Bond.BondDataType $keyType, - Bond.BondDataType $valueType) { - .Call $reader.ReadContainerBegin( - $count, - $keyType, - $valueType); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - $keyType, - $valueType); - .Loop { - .If ($count-- > 0) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $keyType, + Bond.BondDataType $valueType) { + .Call $reader.ReadContainerBegin( + $count, + $keyType, + $valueType); .Block() { - .Default(System.Void); - .Switch ($keyType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($keyType) - }; - .Default(System.Void); - .Default(System.Void); - .Default(System.Void); - .Switch ($valueType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($valueType) - }; - .Default(System.Void) - } - } .Else { - .Break end { } + .Call $writer.WriteContainerBegin( + $count, + $keyType, + $valueType); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Switch ($keyType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($keyType) + }; + .Default(System.Void); + .Default(System.Void); + .Default(System.Void); + .Switch ($valueType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($valueType) + }; + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() } } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } } } @@ -3750,89 +3810,99 @@ }.Lambda #Lambda1( Bond.Protocols.CompactBinaryReader`1[Bond.IO.Unsafe.InputStream] $reader, Bond.Protocols.SimpleBinaryWriter`1[Bond.IO.Unsafe.OutputStream] $writer) { - .Block( - Bond.BondDataType $fieldType, - System.UInt16 $fieldId) { - .Call $reader.ReadStructBegin(); - .Call $writer.WriteStructBegin(null); - .Default(System.Void); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Loop { - .If ($fieldType != .Constant(BT_STOP)) { - .Block() { - .If ($fieldType == .Constant(BT_STOP_BASE)) { - .Call $writer.WriteBaseEnd() - } .Else { - .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + Bond.BondDataType $fieldType, + System.UInt16 $fieldId) { + .Call $reader.ReadStructBegin(); + .Call $writer.WriteStructBegin(null); + .Default(System.Void); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Loop { + .If ($fieldType != .Constant(BT_STOP)) { .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda3)($fieldType) + .If ($fieldType == .Constant(BT_STOP_BASE)) { + .Call $writer.WriteBaseEnd() + } .Else { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda3)($fieldType) + }; + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd() + } }; - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd() + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId) + } + } .Else { + .Break end { } } - }; - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId) + } + .LabelTarget end:; + .Call $reader.ReadStructEnd(); + .Call $writer.WriteStructEnd() } - } .Else { - .Break end { } } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - .LabelTarget end:; - .Call $reader.ReadStructEnd(); - .Call $writer.WriteStructEnd() } } @@ -3850,50 +3920,129 @@ }.Lambda #Lambda1( Bond.Protocols.CompactBinaryReader`1[Bond.IO.Unsafe.InputStream] $reader, Bond.Protocols.SimpleBinaryWriter`1[Bond.IO.Unsafe.OutputStream] $writer) { - .Block( - Bond.BondDataType $fieldType, - System.UInt16 $fieldId) { - .Call $reader.ReadStructBegin(); - .Call $writer.WriteStructBegin(.Constant(GUID)); - .Default(System.Void); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(0)) { - .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + Bond.BondDataType $fieldType, + System.UInt16 $fieldId) { + .Call $reader.ReadStructBegin(); + .Call $writer.WriteStructBegin(.Constant(GUID)); + .Default(System.Void); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - .Constant(0), - .Constant(Data1)); - .If ($fieldType == .Constant(BT_UINT32)) { - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .If ($fieldId == .Constant(0)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(0), + .Constant(Data1)); + .If ($fieldType == .Constant(BT_UINT32)) { + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + } .Else { + .If ($fieldType == .Constant(BT_UINT16)) { + .Call $writer.WriteUInt32((System.UInt32).Call $reader.ReadUInt16()) + } .Else { + .If ($fieldType == .Constant(BT_UINT8)) { + .Call $writer.WriteUInt32((System.UInt32).Call $reader.ReadUInt8()) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_UINT32), + $fieldType) + } + } + }; + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } } .Else { - .If ($fieldType == .Constant(BT_UINT16)) { - .Call $writer.WriteUInt32((System.UInt32).Call $reader.ReadUInt16()) - } .Else { - .If ($fieldType == .Constant(BT_UINT8)) { - .Call $writer.WriteUInt32((System.UInt32).Call $reader.ReadUInt8()) - } .Else { - .Invoke (.Lambda #Lambda2)( + .If ($fieldId > .Constant(0)) { + .Block() { + .Call $writer.WriteFieldOmitted( .Constant(BT_UINT32), - $fieldType) + .Constant(0), + .Constant(Data1)); + .Break end { } + } + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda4)($fieldType) + }; + .Call $writer.WriteFieldEnd() } } }; - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(0)) { + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(0)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_UINT32), @@ -3901,114 +4050,114 @@ .Constant(Data1)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda4)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(0)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_UINT32), - .Constant(0), - .Constant(Data1)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(1)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - .Constant(1), - .Constant(Data2)); - .If ($fieldType == .Constant(BT_UINT16)) { - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .If ($fieldId == .Constant(1)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(1), + .Constant(Data2)); + .If ($fieldType == .Constant(BT_UINT16)) { + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + } .Else { + .If ($fieldType == .Constant(BT_UINT8)) { + .Call $writer.WriteUInt16((System.UInt16).Call $reader.ReadUInt8()) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_UINT16), + $fieldType) + } + }; + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } } .Else { - .If ($fieldType == .Constant(BT_UINT8)) { - .Call $writer.WriteUInt16((System.UInt16).Call $reader.ReadUInt8()) + .If ($fieldId > .Constant(1)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_UINT16), + .Constant(1), + .Constant(Data2)); + .Break end { } + } } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_UINT16), - $fieldType) + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda4)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } } }; - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(1)) { + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(1)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_UINT16), @@ -4016,114 +4165,114 @@ .Constant(Data2)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda4)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(1)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_UINT16), - .Constant(1), - .Constant(Data2)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(2)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - .Constant(2), - .Constant(Data3)); - .If ($fieldType == .Constant(BT_UINT16)) { - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .If ($fieldId == .Constant(2)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(2), + .Constant(Data3)); + .If ($fieldType == .Constant(BT_UINT16)) { + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + } .Else { + .If ($fieldType == .Constant(BT_UINT8)) { + .Call $writer.WriteUInt16((System.UInt16).Call $reader.ReadUInt8()) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_UINT16), + $fieldType) + } + }; + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } } .Else { - .If ($fieldType == .Constant(BT_UINT8)) { - .Call $writer.WriteUInt16((System.UInt16).Call $reader.ReadUInt8()) + .If ($fieldId > .Constant(2)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_UINT16), + .Constant(2), + .Constant(Data3)); + .Break end { } + } } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_UINT16), - $fieldType) + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda4)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } } }; - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(2)) { + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(2)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_UINT16), @@ -4131,122 +4280,122 @@ .Constant(Data3)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda4)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(2)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_UINT16), - .Constant(2), - .Constant(Data3)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(3)) { - .Block() { + .LabelTarget end:; + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - .Constant(3), - .Constant(Data4)); - .If ($fieldType == .Constant(BT_UINT64)) { - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .If ($fieldId == .Constant(3)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(3), + .Constant(Data4)); + .If ($fieldType == .Constant(BT_UINT64)) { + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + } .Else { + .If ($fieldType == .Constant(BT_UINT32)) { + .Call $writer.WriteUInt64((System.UInt64).Call $reader.ReadUInt32()) + } .Else { + .If ($fieldType == .Constant(BT_UINT16)) { + .Call $writer.WriteUInt64((System.UInt64).Call $reader.ReadUInt16()) + } .Else { + .If ($fieldType == .Constant(BT_UINT8)) { + .Call $writer.WriteUInt64((System.UInt64).Call $reader.ReadUInt8()) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_UINT64), + $fieldType) + } + } + } + }; + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } } .Else { - .If ($fieldType == .Constant(BT_UINT32)) { - .Call $writer.WriteUInt64((System.UInt64).Call $reader.ReadUInt32()) + .If ($fieldId > .Constant(3)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_UINT64), + .Constant(3), + .Constant(Data4)); + .Break end { } + } } .Else { - .If ($fieldType == .Constant(BT_UINT16)) { - .Call $writer.WriteUInt64((System.UInt64).Call $reader.ReadUInt16()) - } .Else { - .If ($fieldType == .Constant(BT_UINT8)) { - .Call $writer.WriteUInt64((System.UInt64).Call $reader.ReadUInt8()) - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_UINT64), - $fieldType) - } + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda4)($fieldType) + }; + .Call $writer.WriteFieldEnd() } } }; - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(3)) { + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(3)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_UINT64), @@ -4254,157 +4403,88 @@ .Constant(Data4)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda4)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(3)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_UINT64), - .Constant(3), - .Constant(Data4)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ($fieldType != .Constant(BT_STOP)) { - .Block() { - .If ($fieldType == .Constant(BT_STOP_BASE)) { - .Call $writer.WriteBaseEnd() - } .Else { - .Block() { + .LabelTarget end:; + .Loop { + .If ($fieldType != .Constant(BT_STOP)) { .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda4)($fieldType) + .If ($fieldType == .Constant(BT_STOP_BASE)) { + .Call $writer.WriteBaseEnd() + } .Else { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda4)($fieldType) + }; + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd() + } }; - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd() + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId) + } + } .Else { + .Break end { } } - }; - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId) + } + .LabelTarget end:; + .Call $reader.ReadStructEnd(); + .Call $writer.WriteStructEnd() } - } .Else { - .Break end { } } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - .LabelTarget end:; - .Call $reader.ReadStructEnd(); - .Call $writer.WriteStructEnd() } } @@ -4430,68 +4510,78 @@ }.Lambda #Lambda1( Bond.Protocols.CompactBinaryReader`1[Bond.IO.Unsafe.InputStream] $reader, Bond.Protocols.SimpleBinaryWriter`1[Bond.IO.Unsafe.OutputStream] $writer) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_INT32)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT32)); - .Loop { - .If ($count-- > 0) { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_INT32)) { .Block() { - .Default(System.Void); - .Call $writer.WriteInt32(.Call $reader.ReadInt32()); - .Default(System.Void) + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT32)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Call $writer.WriteInt32(.Call $reader.ReadInt32()); + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() } } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - } - } .Else { - .If ($elementType == .Constant(BT_INT16)) { - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT16)); - .Loop { - .If ($count-- > 0) { + .If ($elementType == .Constant(BT_INT16)) { .Block() { - .Default(System.Void); - .Call $writer.WriteInt32((System.Int32).Call $reader.ReadInt16()); - .Default(System.Void) + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT16)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Call $writer.WriteInt32((System.Int32).Call $reader.ReadInt16()); + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() } } .Else { - .Break end { } + .If ($elementType == .Constant(BT_INT8)) { + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT8)); + .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); + .Call $writer.WriteContainerEnd() + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT32), + $elementType) + } } - } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - } - } .Else { - .If ($elementType == .Constant(BT_INT8)) { - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT8)); - .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); - .Call $writer.WriteContainerEnd() - } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT32), - $elementType) + }; + .Call $reader.ReadContainerEnd() } } - }; - .Call $reader.ReadContainerEnd() + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } } } @@ -4504,40 +4594,50 @@ }.Lambda #Lambda1( Bond.Protocols.CompactBinaryReader`1[Bond.IO.Unsafe.InputStream] $reader, Bond.Protocols.SimpleBinaryWriter`1[Bond.IO.Unsafe.OutputStream] $writer) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_STRUCT)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_STRUCT)); - .Loop { - .If ($count-- > 0) { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_STRUCT)) { .Block() { - .Default(System.Void); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 9); - .Default(System.Void) + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_STRUCT)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 9); + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() } } .Else { - .Break end { } - } + .Invoke (.Lambda #Lambda3)( + .Constant(BT_STRUCT), + $elementType) + }; + .Call $reader.ReadContainerEnd() } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() } - } .Else { - .Invoke (.Lambda #Lambda3)( - .Constant(BT_STRUCT), - $elementType) - }; - .Call $reader.ReadContainerEnd() + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } } } @@ -4559,46 +4659,125 @@ }.Lambda #Lambda1( Bond.Protocols.CompactBinaryReader`1[Bond.IO.Unsafe.InputStream] $reader, Bond.Protocols.SimpleBinaryWriter`1[Bond.IO.Unsafe.OutputStream] $writer) { - .Block( - Bond.BondDataType $fieldType, - System.UInt16 $fieldId) { - .Call $reader.ReadStructBegin(); - .Call $writer.WriteStructBegin(.Constant(Nested)); - .Default(System.Void); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(0)) { - .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + Bond.BondDataType $fieldType, + System.UInt16 $fieldId) { + .Call $reader.ReadStructBegin(); + .Call $writer.WriteStructBegin(.Constant(Nested)); + .Default(System.Void); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - .Constant(0), - .Constant(_double)); - .If ($fieldType == .Constant(BT_DOUBLE)) { - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .If ($fieldId == .Constant(0)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(0), + .Constant(_double)); + .If ($fieldType == .Constant(BT_DOUBLE)) { + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + } .Else { + .If ($fieldType == .Constant(BT_FLOAT)) { + .Call $writer.WriteDouble((System.Double).Call $reader.ReadFloat()) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_DOUBLE), + $fieldType) + } + }; + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } } .Else { - .If ($fieldType == .Constant(BT_FLOAT)) { - .Call $writer.WriteDouble((System.Double).Call $reader.ReadFloat()) + .If ($fieldId > .Constant(0)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_DOUBLE), + .Constant(0), + .Constant(_double)); + .Break end { } + } } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_DOUBLE), - $fieldType) + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda4)($fieldType) + }; + .Call $writer.WriteFieldEnd() + } } }; - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(0)) { + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(0)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_DOUBLE), @@ -4606,157 +4785,88 @@ .Constant(_double)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda4)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(0)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_DOUBLE), - .Constant(0), - .Constant(_double)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ($fieldType != .Constant(BT_STOP)) { - .Block() { - .If ($fieldType == .Constant(BT_STOP_BASE)) { - .Call $writer.WriteBaseEnd() - } .Else { - .Block() { + .LabelTarget end:; + .Loop { + .If ($fieldType != .Constant(BT_STOP)) { .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda4)($fieldType) + .If ($fieldType == .Constant(BT_STOP_BASE)) { + .Call $writer.WriteBaseEnd() + } .Else { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda4)($fieldType) + }; + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd() + } }; - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd() + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId) + } + } .Else { + .Break end { } } - }; - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId) + } + .LabelTarget end:; + .Call $reader.ReadStructEnd(); + .Call $writer.WriteStructEnd() } - } .Else { - .Break end { } } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - .LabelTarget end:; - .Call $reader.ReadStructEnd(); - .Call $writer.WriteStructEnd() } } @@ -4782,85 +4892,40 @@ }.Lambda #Lambda1( Bond.Protocols.CompactBinaryReader`1[Bond.IO.Unsafe.InputStream] $reader, Bond.Protocols.SimpleBinaryWriter`1[Bond.IO.Unsafe.OutputStream] $writer) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_INT8)) { - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT8)); - .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); - .Call $writer.WriteContainerEnd() - } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT8), - $elementType) - }; - .Call $reader.ReadContainerEnd() - } -} - -.Lambda #Lambda2( - Bond.BondDataType $e, - Bond.BondDataType $a) { - .Call Bond.Expressions.ThrowExpression.ThrowInvalidTypeException( - $e, - $a) -}.Lambda #Lambda1( - Bond.Protocols.CompactBinaryReader`1[Bond.IO.Unsafe.InputStream] $reader, - Bond.Protocols.SimpleBinaryWriter`1[Bond.IO.Unsafe.OutputStream] $writer) { - .Block( - System.Int32 $count, - Bond.BondDataType $elementType) { - .Call $reader.ReadContainerBegin( - $count, - $elementType); - .If ($elementType == .Constant(BT_LIST)) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_LIST)); - .Loop { - .If ($count-- > 0) { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( + $count, + $elementType); + .If ($elementType == .Constant(BT_INT8)) { .Block() { - .Default(System.Void); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 10); - .Default(System.Void) + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT8)); + .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); + .Call $writer.WriteContainerEnd() } } .Else { - .Break end { } - } + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT8), + $elementType) + }; + .Call $reader.ReadContainerEnd() } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() } - } .Else { - .Invoke (.Lambda #Lambda3)( - .Constant(BT_LIST), - $elementType) - }; - .Call $reader.ReadContainerEnd() + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } } } -.Lambda #Lambda2( - Bond.Protocols.CompactBinaryReader`1[Bond.IO.Unsafe.InputStream] $r, - Bond.Protocols.SimpleBinaryWriter`1[Bond.IO.Unsafe.OutputStream] $w, - System.Int32 $i) { - .Invoke ((.Constant(ExpressionsTest.Transcoder`2[Bond.Protocols.CompactBinaryReader`1[Bond.IO.Unsafe.InputStream],Bond.Protocols.SimpleBinaryWriter`1[Bond.IO.Unsafe.OutputStream]]).transcode)[$i])( - $r, - $w) -} - -.Lambda #Lambda3( +.Lambda #Lambda2( Bond.BondDataType $e, Bond.BondDataType $a) { .Call Bond.Expressions.ThrowExpression.ThrowInvalidTypeException( @@ -4869,96 +4934,25 @@ }.Lambda #Lambda1( Bond.Protocols.CompactBinaryReader`1[Bond.IO.Unsafe.InputStream] $reader, Bond.Protocols.SimpleBinaryWriter`1[Bond.IO.Unsafe.OutputStream] $writer) { - .Block( - System.Int32 $count, - Bond.BondDataType $keyType, - Bond.BondDataType $valueType) { - .Call $reader.ReadContainerBegin( - $count, - $keyType, - $valueType); - .If ($keyType == .Constant(BT_INT32)) { - .If ($valueType == .Constant(BT_LIST)) { - .Block() { - .Call $writer.WriteContainerBegin( + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $elementType) { + .Call $reader.ReadContainerBegin( $count, - .Constant(BT_INT32), - .Constant(BT_LIST)); - .Loop { - .If ($count-- > 0) { - .Block() { - .Default(System.Void); - .Call $writer.WriteInt32(.Call $reader.ReadInt32()); - .Default(System.Void); - .Default(System.Void); - .Default(System.Void); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 10); - .Default(System.Void) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - } - } .Else { - .Invoke (.Lambda #Lambda3)( - .Constant(BT_LIST), - $valueType) - } - } .Else { - .If ($keyType == .Constant(BT_INT16)) { - .If ($valueType == .Constant(BT_LIST)) { - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT16), - .Constant(BT_LIST)); - .Loop { - .If ($count-- > 0) { - .Block() { - .Default(System.Void); - .Call $writer.WriteInt32((System.Int32).Call $reader.ReadInt16()); - .Default(System.Void); - .Default(System.Void); - .Default(System.Void); - .Invoke (.Lambda #Lambda2)( - $reader, - $writer, - 10); - .Default(System.Void) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - } - } .Else { - .Invoke (.Lambda #Lambda3)( - .Constant(BT_LIST), - $valueType) - } - } .Else { - .If ($keyType == .Constant(BT_INT8)) { - .If ($valueType == .Constant(BT_LIST)) { + $elementType); + .If ($elementType == .Constant(BT_LIST)) { .Block() { .Call $writer.WriteContainerBegin( $count, - .Constant(BT_INT8), .Constant(BT_LIST)); .Loop { .If ($count-- > 0) { .Block() { - .Default(System.Void); - .Call $writer.WriteInt32((System.Int32).Call $reader.ReadInt8()); - .Default(System.Void); - .Default(System.Void); .Default(System.Void); .Invoke (.Lambda #Lambda2)( $reader, @@ -4976,16 +4970,14 @@ } .Else { .Invoke (.Lambda #Lambda3)( .Constant(BT_LIST), - $valueType) - } - } .Else { - .Invoke (.Lambda #Lambda3)( - .Constant(BT_INT32), - $keyType) + $elementType) + }; + .Call $reader.ReadContainerEnd() } } - }; - .Call $reader.ReadContainerEnd() + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } } } @@ -5007,169 +4999,183 @@ }.Lambda #Lambda1( Bond.Protocols.CompactBinaryReader`1[Bond.IO.Unsafe.InputStream] $reader, Bond.Protocols.SimpleBinaryWriter`1[Bond.IO.Unsafe.OutputStream] $writer) { - .Block( - System.Int32 $count, - Bond.BondDataType $keyType, - Bond.BondDataType $valueType) { - .Call $reader.ReadContainerBegin( - $count, - $keyType, - $valueType); - .If ($keyType == .Constant(BT_INT32)) { - .If ($valueType == .Constant(BT_DOUBLE)) { - .Block() { - .Call $writer.WriteContainerBegin( + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $keyType, + Bond.BondDataType $valueType) { + .Call $reader.ReadContainerBegin( $count, - .Constant(BT_INT32), - .Constant(BT_DOUBLE)); - .Loop { - .If ($count-- > 0) { + $keyType, + $valueType); + .If ($keyType == .Constant(BT_INT32)) { + .If ($valueType == .Constant(BT_LIST)) { .Block() { - .Default(System.Void); - .Call $writer.WriteInt32(.Call $reader.ReadInt32()); - .Default(System.Void); - .Default(System.Void); - .Default(System.Void); - .Call $writer.WriteDouble(.Call $reader.ReadDouble()); - .Default(System.Void) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - } - } .Else { - .If ($valueType == .Constant(BT_FLOAT)) { - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT32), - .Constant(BT_FLOAT)); - .Loop { - .If ($count-- > 0) { - .Block() { - .Default(System.Void); - .Call $writer.WriteInt32(.Call $reader.ReadInt32()); - .Default(System.Void); - .Default(System.Void); - .Default(System.Void); - .Call $writer.WriteDouble((System.Double).Call $reader.ReadFloat()); - .Default(System.Void) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_DOUBLE), - $valueType) - } - } - } .Else { - .If ($keyType == .Constant(BT_INT16)) { - .If ($valueType == .Constant(BT_DOUBLE)) { - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT16), - .Constant(BT_DOUBLE)); - .Loop { - .If ($count-- > 0) { - .Block() { - .Default(System.Void); - .Call $writer.WriteInt32((System.Int32).Call $reader.ReadInt16()); - .Default(System.Void); - .Default(System.Void); - .Default(System.Void); - .Call $writer.WriteDouble(.Call $reader.ReadDouble()); - .Default(System.Void) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - } - } .Else { - .If ($valueType == .Constant(BT_FLOAT)) { - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT16), - .Constant(BT_FLOAT)); - .Loop { - .If ($count-- > 0) { - .Block() { - .Default(System.Void); - .Call $writer.WriteInt32((System.Int32).Call $reader.ReadInt16()); - .Default(System.Void); - .Default(System.Void); - .Default(System.Void); - .Call $writer.WriteDouble((System.Double).Call $reader.ReadFloat()); - .Default(System.Void) + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT32), + .Constant(BT_LIST)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Call $writer.WriteInt32(.Call $reader.ReadInt32()); + .Default(System.Void); + .Default(System.Void); + .Default(System.Void); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 10); + .Default(System.Void) + } + } .Else { + .Break end { } } - } .Else { - .Break end { } } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() + } .Else { + .Invoke (.Lambda #Lambda3)( + .Constant(BT_LIST), + $valueType) } } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_DOUBLE), - $valueType) - } - } - } .Else { - .If ($keyType == .Constant(BT_INT8)) { - .If ($valueType == .Constant(BT_DOUBLE)) { - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT8), - .Constant(BT_DOUBLE)); - .Loop { - .If ($count-- > 0) { + .If ($keyType == .Constant(BT_INT16)) { + .If ($valueType == .Constant(BT_LIST)) { + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT16), + .Constant(BT_LIST)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Call $writer.WriteInt32((System.Int32).Call $reader.ReadInt16()); + .Default(System.Void); + .Default(System.Void); + .Default(System.Void); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 10); + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + } + } .Else { + .Invoke (.Lambda #Lambda3)( + .Constant(BT_LIST), + $valueType) + } + } .Else { + .If ($keyType == .Constant(BT_INT8)) { + .If ($valueType == .Constant(BT_LIST)) { .Block() { - .Default(System.Void); - .Call $writer.WriteInt32((System.Int32).Call $reader.ReadInt8()); - .Default(System.Void); - .Default(System.Void); - .Default(System.Void); - .Call $writer.WriteDouble(.Call $reader.ReadDouble()); - .Default(System.Void) + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT8), + .Constant(BT_LIST)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Call $writer.WriteInt32((System.Int32).Call $reader.ReadInt8()); + .Default(System.Void); + .Default(System.Void); + .Default(System.Void); + .Invoke (.Lambda #Lambda2)( + $reader, + $writer, + 10); + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() } } .Else { - .Break end { } + .Invoke (.Lambda #Lambda3)( + .Constant(BT_LIST), + $valueType) } + } .Else { + .Invoke (.Lambda #Lambda3)( + .Constant(BT_INT32), + $keyType) } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() } - } .Else { - .If ($valueType == .Constant(BT_FLOAT)) { + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + } +} + +.Lambda #Lambda2( + Bond.Protocols.CompactBinaryReader`1[Bond.IO.Unsafe.InputStream] $r, + Bond.Protocols.SimpleBinaryWriter`1[Bond.IO.Unsafe.OutputStream] $w, + System.Int32 $i) { + .Invoke ((.Constant(ExpressionsTest.Transcoder`2[Bond.Protocols.CompactBinaryReader`1[Bond.IO.Unsafe.InputStream],Bond.Protocols.SimpleBinaryWriter`1[Bond.IO.Unsafe.OutputStream]]).transcode)[$i])( + $r, + $w) +} + +.Lambda #Lambda3( + Bond.BondDataType $e, + Bond.BondDataType $a) { + .Call Bond.Expressions.ThrowExpression.ThrowInvalidTypeException( + $e, + $a) +}.Lambda #Lambda1( + Bond.Protocols.CompactBinaryReader`1[Bond.IO.Unsafe.InputStream] $reader, + Bond.Protocols.SimpleBinaryWriter`1[Bond.IO.Unsafe.OutputStream] $writer) { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + System.Int32 $count, + Bond.BondDataType $keyType, + Bond.BondDataType $valueType) { + .Call $reader.ReadContainerBegin( + $count, + $keyType, + $valueType); + .If ($keyType == .Constant(BT_INT32)) { + .If ($valueType == .Constant(BT_DOUBLE)) { .Block() { .Call $writer.WriteContainerBegin( $count, - .Constant(BT_INT8), - .Constant(BT_FLOAT)); + .Constant(BT_INT32), + .Constant(BT_DOUBLE)); .Loop { .If ($count-- > 0) { .Block() { .Default(System.Void); - .Call $writer.WriteInt32((System.Int32).Call $reader.ReadInt8()); + .Call $writer.WriteInt32(.Call $reader.ReadInt32()); .Default(System.Void); .Default(System.Void); .Default(System.Void); - .Call $writer.WriteDouble((System.Double).Call $reader.ReadFloat()); + .Call $writer.WriteDouble(.Call $reader.ReadDouble()); .Default(System.Void) } } .Else { @@ -5180,19 +5186,163 @@ .Call $writer.WriteContainerEnd() } } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_DOUBLE), - $valueType) + .If ($valueType == .Constant(BT_FLOAT)) { + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT32), + .Constant(BT_FLOAT)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Call $writer.WriteInt32(.Call $reader.ReadInt32()); + .Default(System.Void); + .Default(System.Void); + .Default(System.Void); + .Call $writer.WriteDouble((System.Double).Call $reader.ReadFloat()); + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_DOUBLE), + $valueType) + } } - } - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT32), - $keyType) + } .Else { + .If ($keyType == .Constant(BT_INT16)) { + .If ($valueType == .Constant(BT_DOUBLE)) { + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT16), + .Constant(BT_DOUBLE)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Call $writer.WriteInt32((System.Int32).Call $reader.ReadInt16()); + .Default(System.Void); + .Default(System.Void); + .Default(System.Void); + .Call $writer.WriteDouble(.Call $reader.ReadDouble()); + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + } + } .Else { + .If ($valueType == .Constant(BT_FLOAT)) { + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT16), + .Constant(BT_FLOAT)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Call $writer.WriteInt32((System.Int32).Call $reader.ReadInt16()); + .Default(System.Void); + .Default(System.Void); + .Default(System.Void); + .Call $writer.WriteDouble((System.Double).Call $reader.ReadFloat()); + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_DOUBLE), + $valueType) + } + } + } .Else { + .If ($keyType == .Constant(BT_INT8)) { + .If ($valueType == .Constant(BT_DOUBLE)) { + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT8), + .Constant(BT_DOUBLE)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Call $writer.WriteInt32((System.Int32).Call $reader.ReadInt8()); + .Default(System.Void); + .Default(System.Void); + .Default(System.Void); + .Call $writer.WriteDouble(.Call $reader.ReadDouble()); + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + } + } .Else { + .If ($valueType == .Constant(BT_FLOAT)) { + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT8), + .Constant(BT_FLOAT)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Call $writer.WriteInt32((System.Int32).Call $reader.ReadInt8()); + .Default(System.Void); + .Default(System.Void); + .Default(System.Void); + .Call $writer.WriteDouble((System.Double).Call $reader.ReadFloat()); + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_DOUBLE), + $valueType) + } + } + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT32), + $keyType) + } + } + }; + .Call $reader.ReadContainerEnd() } } - }; - .Call $reader.ReadContainerEnd() + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } } } @@ -5205,54 +5355,133 @@ }.Lambda #Lambda1( Bond.Protocols.CompactBinaryReader`1[Bond.IO.Unsafe.InputStream] $reader, Bond.Protocols.SimpleBinaryWriter`1[Bond.IO.Unsafe.OutputStream] $writer) { - .Block( - Bond.BondDataType $fieldType, - System.UInt16 $fieldId) { - .Call $reader.ReadStructBegin(); - .Call $writer.WriteStructBegin(.Constant(Generic)); - .Default(System.Void); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(0)) { - .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + Bond.BondDataType $fieldType, + System.UInt16 $fieldId) { + .Call $reader.ReadStructBegin(); + .Call $writer.WriteStructBegin(.Constant(Generic)); + .Default(System.Void); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - .Constant(0), - .Constant(value)); - .If ($fieldType == .Constant(BT_INT64)) { - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .If ($fieldId == .Constant(0)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(0), + .Constant(value)); + .If ($fieldType == .Constant(BT_INT64)) { + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + } .Else { + .If ($fieldType == .Constant(BT_INT32)) { + .Call $writer.WriteInt64((System.Int64).Call $reader.ReadInt32()) + } .Else { + .If ($fieldType == .Constant(BT_INT16)) { + .Call $writer.WriteInt64((System.Int64).Call $reader.ReadInt16()) + } .Else { + .If ($fieldType == .Constant(BT_INT8)) { + .Call $writer.WriteInt64((System.Int64).Call $reader.ReadInt8()) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT64), + $fieldType) + } + } + } + }; + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } } .Else { - .If ($fieldType == .Constant(BT_INT32)) { - .Call $writer.WriteInt64((System.Int64).Call $reader.ReadInt32()) + .If ($fieldId > .Constant(0)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_INT64), + .Constant(0), + .Constant(value)); + .Break end { } + } } .Else { - .If ($fieldType == .Constant(BT_INT16)) { - .Call $writer.WriteInt64((System.Int64).Call $reader.ReadInt16()) - } .Else { - .If ($fieldType == .Constant(BT_INT8)) { - .Call $writer.WriteInt64((System.Int64).Call $reader.ReadInt8()) - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT64), - $fieldType) - } + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda4)($fieldType) + }; + .Call $writer.WriteFieldEnd() } } }; - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(0)) { + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(0)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_INT64), @@ -5260,157 +5489,88 @@ .Constant(value)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda4)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(0)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_INT64), - .Constant(0), - .Constant(value)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ($fieldType != .Constant(BT_STOP)) { - .Block() { - .If ($fieldType == .Constant(BT_STOP_BASE)) { - .Call $writer.WriteBaseEnd() - } .Else { - .Block() { + .LabelTarget end:; + .Loop { + .If ($fieldType != .Constant(BT_STOP)) { .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda4)($fieldType) + .If ($fieldType == .Constant(BT_STOP_BASE)) { + .Call $writer.WriteBaseEnd() + } .Else { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda4)($fieldType) + }; + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd() + } }; - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd() + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId) + } + } .Else { + .Break end { } } - }; - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId) + } + .LabelTarget end:; + .Call $reader.ReadStructEnd(); + .Call $writer.WriteStructEnd() } - } .Else { - .Break end { } } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - .LabelTarget end:; - .Call $reader.ReadStructEnd(); - .Call $writer.WriteStructEnd() } } @@ -5436,54 +5596,133 @@ }.Lambda #Lambda1( Bond.Protocols.CompactBinaryReader`1[Bond.IO.Unsafe.InputStream] $reader, Bond.Protocols.SimpleBinaryWriter`1[Bond.IO.Unsafe.OutputStream] $writer) { - .Block( - Bond.BondDataType $fieldType, - System.UInt16 $fieldId) { - .Call $reader.ReadStructBegin(); - .Call $writer.WriteStructBegin(.Constant(GenericNothing)); - .Default(System.Void); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Loop { - .If ((System.Int32)$fieldType > 1) { - .Block() { - .If ($fieldId == .Constant(0)) { - .Block() { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block( + Bond.BondDataType $fieldType, + System.UInt16 $fieldId) { + .Call $reader.ReadStructBegin(); + .Call $writer.WriteStructBegin(.Constant(GenericNothing)); + .Default(System.Void); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Loop { + .If ((System.Int32)$fieldType > 1) { .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - .Constant(0), - .Constant(value)); - .If ($fieldType == .Constant(BT_INT64)) { - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .If ($fieldId == .Constant(0)) { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + .Constant(0), + .Constant(value)); + .If ($fieldType == .Constant(BT_INT64)) { + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + } .Else { + .If ($fieldType == .Constant(BT_INT32)) { + .Call $writer.WriteInt64((System.Int64).Call $reader.ReadInt32()) + } .Else { + .If ($fieldType == .Constant(BT_INT16)) { + .Call $writer.WriteInt64((System.Int64).Call $reader.ReadInt16()) + } .Else { + .If ($fieldType == .Constant(BT_INT8)) { + .Call $writer.WriteInt64((System.Int64).Call $reader.ReadInt8()) + } .Else { + .Invoke (.Lambda #Lambda2)( + .Constant(BT_INT64), + $fieldType) + } + } + } + }; + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .Break end { } + } } .Else { - .If ($fieldType == .Constant(BT_INT32)) { - .Call $writer.WriteInt64((System.Int64).Call $reader.ReadInt32()) + .If ($fieldId > .Constant(0)) { + .Block() { + .Call $writer.WriteFieldOmitted( + .Constant(BT_INT64), + .Constant(0), + .Constant(value)); + .Break end { } + } } .Else { - .If ($fieldType == .Constant(BT_INT16)) { - .Call $writer.WriteInt64((System.Int64).Call $reader.ReadInt16()) - } .Else { - .If ($fieldType == .Constant(BT_INT8)) { - .Call $writer.WriteInt64((System.Int64).Call $reader.ReadInt8()) - } .Else { - .Invoke (.Lambda #Lambda2)( - .Constant(BT_INT64), - $fieldType) - } + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda4)($fieldType) + }; + .Call $writer.WriteFieldEnd() } } }; - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .Break end { } - } - } .Else { - .If ($fieldId > .Constant(0)) { + .Call $reader.ReadFieldEnd(); + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId); + .If ($fieldId > .Constant(0)) { + .Break end { } + } .Else { + .Default(System.Void) + } + } + } .Else { .Block() { .Call $writer.WriteFieldOmitted( .Constant(BT_INT64), @@ -5491,157 +5730,88 @@ .Constant(value)); .Break end { } } - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda4)($fieldType) - }; - .Call $writer.WriteFieldEnd() - } } - }; - .Call $reader.ReadFieldEnd(); - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId); - .If ($fieldId > .Constant(0)) { - .Break end { } - } .Else { - .Default(System.Void) } - } - } .Else { - .Block() { - .Call $writer.WriteFieldOmitted( - .Constant(BT_INT64), - .Constant(0), - .Constant(value)); - .Break end { } - } - } - } - .LabelTarget end:; - .Loop { - .If ($fieldType != .Constant(BT_STOP)) { - .Block() { - .If ($fieldType == .Constant(BT_STOP_BASE)) { - .Call $writer.WriteBaseEnd() - } .Else { - .Block() { + .LabelTarget end:; + .Loop { + .If ($fieldType != .Constant(BT_STOP)) { .Block() { - .Call $writer.WriteFieldBegin( - $fieldType, - $fieldId, - null); - .Switch ($fieldType) { - .Case (.Constant(BT_LIST)): - .Case (.Constant(BT_SET)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 3) - .Case (.Constant(BT_MAP)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 4) - .Case (.Constant(BT_STRUCT)): - .Invoke (.Lambda #Lambda3)( - $reader, - $writer, - 5) - .Case (.Constant(BT_BOOL)): - .Call $writer.WriteBool(.Call $reader.ReadBool()) - .Case (.Constant(BT_UINT8)): - .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) - .Case (.Constant(BT_UINT16)): - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) - .Case (.Constant(BT_UINT32)): - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) - .Case (.Constant(BT_UINT64)): - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) - .Case (.Constant(BT_FLOAT)): - .Call $writer.WriteFloat(.Call $reader.ReadFloat()) - .Case (.Constant(BT_DOUBLE)): - .Call $writer.WriteDouble(.Call $reader.ReadDouble()) - .Case (.Constant(BT_STRING)): - .Call $writer.WriteString(.Call $reader.ReadString()) - .Case (.Constant(BT_INT8)): - .Call $writer.WriteInt8(.Call $reader.ReadInt8()) - .Case (.Constant(BT_INT16)): - .Call $writer.WriteInt16(.Call $reader.ReadInt16()) - .Case (.Constant(BT_INT32)): - .Call $writer.WriteInt32(.Call $reader.ReadInt32()) - .Case (.Constant(BT_INT64)): - .Call $writer.WriteInt64(.Call $reader.ReadInt64()) - .Case (.Constant(BT_WSTRING)): - .Call $writer.WriteWString(.Call $reader.ReadWString()) - .Default: - .Invoke (.Lambda #Lambda4)($fieldType) + .If ($fieldType == .Constant(BT_STOP_BASE)) { + .Call $writer.WriteBaseEnd() + } .Else { + .Block() { + .Block() { + .Call $writer.WriteFieldBegin( + $fieldType, + $fieldId, + null); + .Switch ($fieldType) { + .Case (.Constant(BT_LIST)): + .Case (.Constant(BT_SET)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 3) + .Case (.Constant(BT_MAP)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 4) + .Case (.Constant(BT_STRUCT)): + .Invoke (.Lambda #Lambda3)( + $reader, + $writer, + 5) + .Case (.Constant(BT_BOOL)): + .Call $writer.WriteBool(.Call $reader.ReadBool()) + .Case (.Constant(BT_UINT8)): + .Call $writer.WriteUInt8(.Call $reader.ReadUInt8()) + .Case (.Constant(BT_UINT16)): + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()) + .Case (.Constant(BT_UINT32)): + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()) + .Case (.Constant(BT_UINT64)): + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()) + .Case (.Constant(BT_FLOAT)): + .Call $writer.WriteFloat(.Call $reader.ReadFloat()) + .Case (.Constant(BT_DOUBLE)): + .Call $writer.WriteDouble(.Call $reader.ReadDouble()) + .Case (.Constant(BT_STRING)): + .Call $writer.WriteString(.Call $reader.ReadString()) + .Case (.Constant(BT_INT8)): + .Call $writer.WriteInt8(.Call $reader.ReadInt8()) + .Case (.Constant(BT_INT16)): + .Call $writer.WriteInt16(.Call $reader.ReadInt16()) + .Case (.Constant(BT_INT32)): + .Call $writer.WriteInt32(.Call $reader.ReadInt32()) + .Case (.Constant(BT_INT64)): + .Call $writer.WriteInt64(.Call $reader.ReadInt64()) + .Case (.Constant(BT_WSTRING)): + .Call $writer.WriteWString(.Call $reader.ReadWString()) + .Default: + .Invoke (.Lambda #Lambda4)($fieldType) + }; + .Call $writer.WriteFieldEnd() + }; + .Call $reader.ReadFieldEnd() + } }; - .Call $writer.WriteFieldEnd() - }; - .Call $reader.ReadFieldEnd() + .Call $reader.ReadFieldBegin( + $fieldType, + $fieldId) + } + } .Else { + .Break end { } } - }; - .Call $reader.ReadFieldBegin( - $fieldType, - $fieldId) + } + .LabelTarget end:; + .Call $reader.ReadStructEnd(); + .Call $writer.WriteStructEnd() } - } .Else { - .Break end { } } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - .LabelTarget end:; - .Call $reader.ReadStructEnd(); - .Call $writer.WriteStructEnd() } } diff --git a/cs/test/expressions/TranscodeSPCB.expressions b/cs/test/expressions/TranscodeSPCB.expressions index 0e23716525..fdaab29259 100644 --- a/cs/test/expressions/TranscodeSPCB.expressions +++ b/cs/test/expressions/TranscodeSPCB.expressions @@ -1,202 +1,120 @@ .Lambda #Lambda1( Bond.Protocols.SimpleBinaryReader`1[Bond.IO.Unsafe.InputStream] $reader, Bond.Protocols.CompactBinaryWriter`1[Bond.IO.Unsafe.OutputStream] $writer) { - .Block() { - .Call $writer.WriteStructBegin(.Constant(Example)); - .Block() { - .Call $writer.WriteBaseBegin(.Constant(Base)); - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(0), - .Constant(vvb)) - } .Else { + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_LIST), - .Constant(0), - .Constant(vvb)); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_LIST)); - .Loop { - .If ($count-- > 0) { - .Block() { - .Default(System.Void); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_UINT64)); - .Loop { - .If ($count-- > 0) { - .Block() { - .Default(System.Void); - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()); - .Default(System.Void) + .Call $writer.WriteStructBegin(.Constant(Example)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block() { + .Call $writer.WriteBaseBegin(.Constant(Base)); + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(0), + .Constant(vvb)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_LIST), + .Constant(0), + .Constant(vvb)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_LIST)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_UINT64)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()); + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() } - } .Else { - .Break end { } } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() }; - .Call $reader.ReadContainerEnd() - }; - .Default(System.Void) - } - } .Else { - .Break end { } + .Call $writer.WriteFieldEnd() + } + }; + .Call $writer.WriteBaseEnd() } } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } }; - .Call $writer.WriteFieldEnd() - } - }; - .Call $writer.WriteBaseEnd() - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_BOOL), - .Constant(0), - .Constant(_bool)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_BOOL), - .Constant(0), - .Constant(_bool)); - .Call $writer.WriteBool(.Call $reader.ReadBool()); - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_STRING), - .Constant(2), - .Constant(_str)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_STRING), - .Constant(2), - .Constant(_str)); - .Call $writer.WriteString(.Call $reader.ReadString()); - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_UINT32), - .Constant(12), - .Constant(_uint32)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_UINT32), - .Constant(12), - .Constant(_uint32)); - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()); - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_INT8), - .Constant(14), - .Constant(_int8)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_INT8), - .Constant(14), - .Constant(_int8)); - .Call $writer.WriteInt8(.Call $reader.ReadInt8()); - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_INT64), - .Constant(17), - .Constant(_int64)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_INT64), - .Constant(17), - .Constant(_int64)); - .Call $writer.WriteInt64(.Call $reader.ReadInt64()); - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_DOUBLE), - .Constant(18), - .Constant(_double)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_DOUBLE), - .Constant(18), - .Constant(_double)); - .Call $writer.WriteDouble(.Call $reader.ReadDouble()); - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_STRUCT), - .Constant(20), - .Constant(guid)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_STRUCT), - .Constant(20), - .Constant(guid)); - .Block() { - .Call $writer.WriteStructBegin(.Constant(GUID)); .If ( .Call $reader.ReadFieldOmitted() ) { .Call $writer.WriteFieldOmitted( - .Constant(BT_UINT32), + .Constant(BT_BOOL), .Constant(0), - .Constant(Data1)) + .Constant(_bool)) } .Else { .Block() { .Call $writer.WriteFieldBegin( - .Constant(BT_UINT32), + .Constant(BT_BOOL), .Constant(0), - .Constant(Data1)); - .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()); + .Constant(_bool)); + .Call $writer.WriteBool(.Call $reader.ReadBool()); .Call $writer.WriteFieldEnd() } }; @@ -204,16 +122,16 @@ .Call $reader.ReadFieldOmitted() ) { .Call $writer.WriteFieldOmitted( - .Constant(BT_UINT16), - .Constant(1), - .Constant(Data2)) + .Constant(BT_STRING), + .Constant(2), + .Constant(_str)) } .Else { .Block() { .Call $writer.WriteFieldBegin( - .Constant(BT_UINT16), - .Constant(1), - .Constant(Data2)); - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()); + .Constant(BT_STRING), + .Constant(2), + .Constant(_str)); + .Call $writer.WriteString(.Call $reader.ReadString()); .Call $writer.WriteFieldEnd() } }; @@ -221,16 +139,16 @@ .Call $reader.ReadFieldOmitted() ) { .Call $writer.WriteFieldOmitted( - .Constant(BT_UINT16), - .Constant(2), - .Constant(Data3)) + .Constant(BT_UINT32), + .Constant(12), + .Constant(_uint32)) } .Else { .Block() { .Call $writer.WriteFieldBegin( - .Constant(BT_UINT16), - .Constant(2), - .Constant(Data3)); - .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()); + .Constant(BT_UINT32), + .Constant(12), + .Constant(_uint32)); + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()); .Call $writer.WriteFieldEnd() } }; @@ -238,936 +156,1408 @@ .Call $reader.ReadFieldOmitted() ) { .Call $writer.WriteFieldOmitted( - .Constant(BT_UINT64), - .Constant(3), - .Constant(Data4)) + .Constant(BT_INT8), + .Constant(14), + .Constant(_int8)) } .Else { .Block() { .Call $writer.WriteFieldBegin( - .Constant(BT_UINT64), - .Constant(3), - .Constant(Data4)); - .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()); + .Constant(BT_INT8), + .Constant(14), + .Constant(_int8)); + .Call $writer.WriteInt8(.Call $reader.ReadInt8()); .Call $writer.WriteFieldEnd() } }; - .Call $writer.WriteStructEnd() - }; - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(30), - .Constant(_int32Vector)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_LIST), - .Constant(30), - .Constant(_int32Vector)); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT32)); - .Loop { - .If ($count-- > 0) { - .Block() { - .Default(System.Void); - .Call $writer.WriteInt32(.Call $reader.ReadInt32()); - .Default(System.Void) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(40), - .Constant(_nestedVector)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_LIST), - .Constant(40), - .Constant(_nestedVector)); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_STRUCT)); - .Loop { - .If ($count-- > 0) { - .Block() { - .Default(System.Void); - .Block() { - .Call $writer.WriteStructBegin(.Constant(Nested)); - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_DOUBLE), - .Constant(0), - .Constant(_double)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_DOUBLE), - .Constant(0), - .Constant(_double)); - .Call $writer.WriteDouble(.Call $reader.ReadDouble()); - .Call $writer.WriteFieldEnd() - } - }; - .Call $writer.WriteStructEnd() - }; - .Default(System.Void) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(50), - .Constant(b)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_LIST), - .Constant(50), - .Constant(b)); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT8)); - .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(51), - .Constant(_blobList)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_LIST), - .Constant(51), - .Constant(_blobList)); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_LIST)); - .Loop { - .If ($count-- > 0) { - .Block() { - .Default(System.Void); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT8)); - .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Default(System.Void) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(52), - .Constant(_blobVector)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_LIST), - .Constant(52), - .Constant(_blobVector)); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_LIST)); - .Loop { - .If ($count-- > 0) { - .Block() { - .Default(System.Void); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT8)); - .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Default(System.Void) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_MAP), - .Constant(53), - .Constant(_blobMap)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_MAP), - .Constant(53), - .Constant(_blobMap)); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT32), - .Constant(BT_LIST)); - .Loop { - .If ($count-- > 0) { - .Block() { - .Default(System.Void); - .Call $writer.WriteInt32(.Call $reader.ReadInt32()); - .Default(System.Void); - .Default(System.Void); - .Default(System.Void); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT8)); - .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Default(System.Void) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(54), - .Constant(_blobNullable)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_LIST), - .Constant(54), - .Constant(_blobNullable)); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_LIST)); - .Loop { - .If ($count-- > 0) { - .Block() { - .Default(System.Void); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT8)); - .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Default(System.Void) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_MAP), - .Constant(60), - .Constant(_map)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_MAP), - .Constant(60), - .Constant(_map)); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT32), - .Constant(BT_DOUBLE)); - .Loop { - .If ($count-- > 0) { - .Block() { - .Default(System.Void); - .Call $writer.WriteInt32(.Call $reader.ReadInt32()); - .Default(System.Void); - .Default(System.Void); - .Default(System.Void); - .Call $writer.WriteDouble(.Call $reader.ReadDouble()); - .Default(System.Void) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(70), - .Constant(_decimal)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_LIST), - .Constant(70), - .Constant(_decimal)); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT8)); - .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(71), - .Constant(_decList)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_LIST), - .Constant(71), - .Constant(_decList)); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_LIST)); - .Loop { - .If ($count-- > 0) { - .Block() { - .Default(System.Void); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT8)); - .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Default(System.Void) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(72), - .Constant(_decVector)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_LIST), - .Constant(72), - .Constant(_decVector)); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_LIST)); - .Loop { - .If ($count-- > 0) { - .Block() { - .Default(System.Void); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT8)); - .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Default(System.Void) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_MAP), - .Constant(73), - .Constant(_decMap)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_MAP), - .Constant(73), - .Constant(_decMap)); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT32), - .Constant(BT_LIST)); - .Loop { - .If ($count-- > 0) { - .Block() { - .Default(System.Void); - .Call $writer.WriteInt32(.Call $reader.ReadInt32()); - .Default(System.Void); - .Default(System.Void); - .Default(System.Void); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT8)); - .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Default(System.Void) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(74), - .Constant(_decNullable)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_LIST), - .Constant(74), - .Constant(_decNullable)); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_LIST)); - .Loop { - .If ($count-- > 0) { - .Block() { - .Default(System.Void); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT8)); - .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Default(System.Void) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(75), - .Constant(_decimal_req)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_LIST), - .Constant(75), - .Constant(_decimal_req)); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT8)); - .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(80), - .Constant(_reference)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_LIST), - .Constant(80), - .Constant(_reference)); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT8)); - .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(81), - .Constant(_refList)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_LIST), - .Constant(81), - .Constant(_refList)); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_LIST)); - .Loop { - .If ($count-- > 0) { - .Block() { - .Default(System.Void); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT8)); - .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Default(System.Void) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(82), - .Constant(_refVector)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_LIST), - .Constant(82), - .Constant(_refVector)); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_LIST)); - .Loop { - .If ($count-- > 0) { - .Block() { - .Default(System.Void); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT8)); - .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Default(System.Void) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_MAP), - .Constant(83), - .Constant(_refMap)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_MAP), - .Constant(83), - .Constant(_refMap)); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT32), - .Constant(BT_LIST)); - .Loop { - .If ($count-- > 0) { - .Block() { - .Default(System.Void); - .Call $writer.WriteInt32(.Call $reader.ReadInt32()); - .Default(System.Void); - .Default(System.Void); - .Default(System.Void); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT8)); - .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Default(System.Void) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_LIST), - .Constant(84), - .Constant(_refNullable)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_LIST), - .Constant(84), - .Constant(_refNullable)); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_LIST)); - .Loop { - .If ($count-- > 0) { - .Block() { - .Default(System.Void); - .Block(System.Int32 $count) { - $count = .Call $reader.ReadContainerBegin(); - .Block() { - .Call $writer.WriteContainerBegin( - $count, - .Constant(BT_INT8)); - .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Default(System.Void) - } - } .Else { - .Break end { } - } - } - .LabelTarget end:; - .Call $writer.WriteContainerEnd() - }; - .Call $reader.ReadContainerEnd() - }; - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_STRUCT), - .Constant(85), - .Constant(_dt)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_STRUCT), - .Constant(85), - .Constant(_dt)); - .Block() { - .Call $writer.WriteStructBegin(.Constant(Generic)); .If ( .Call $reader.ReadFieldOmitted() ) { .Call $writer.WriteFieldOmitted( .Constant(BT_INT64), - .Constant(0), - .Constant(value)) + .Constant(17), + .Constant(_int64)) } .Else { .Block() { .Call $writer.WriteFieldBegin( .Constant(BT_INT64), - .Constant(0), - .Constant(value)); + .Constant(17), + .Constant(_int64)); .Call $writer.WriteInt64(.Call $reader.ReadInt64()); .Call $writer.WriteFieldEnd() } }; - .Call $writer.WriteStructEnd() - }; - .Call $writer.WriteFieldEnd() - } - }; - .If ( - .Call $reader.ReadFieldOmitted() - ) { - .Call $writer.WriteFieldOmitted( - .Constant(BT_STRUCT), - .Constant(86), - .Constant(_dt2)) - } .Else { - .Block() { - .Call $writer.WriteFieldBegin( - .Constant(BT_STRUCT), - .Constant(86), - .Constant(_dt2)); - .Block() { - .Call $writer.WriteStructBegin(.Constant(GenericNothing)); .If ( .Call $reader.ReadFieldOmitted() ) { .Call $writer.WriteFieldOmitted( - .Constant(BT_INT64), - .Constant(0), - .Constant(value)) + .Constant(BT_DOUBLE), + .Constant(18), + .Constant(_double)) } .Else { .Block() { .Call $writer.WriteFieldBegin( - .Constant(BT_INT64), - .Constant(0), - .Constant(value)); - .Call $writer.WriteInt64(.Call $reader.ReadInt64()); + .Constant(BT_DOUBLE), + .Constant(18), + .Constant(_double)); + .Call $writer.WriteDouble(.Call $reader.ReadDouble()); .Call $writer.WriteFieldEnd() } }; - .Call $writer.WriteStructEnd() - }; - .Call $writer.WriteFieldEnd() + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_STRUCT), + .Constant(20), + .Constant(guid)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_STRUCT), + .Constant(20), + .Constant(guid)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block() { + .Call $writer.WriteStructBegin(.Constant(GUID)); + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_UINT32), + .Constant(0), + .Constant(Data1)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_UINT32), + .Constant(0), + .Constant(Data1)); + .Call $writer.WriteUInt32(.Call $reader.ReadUInt32()); + .Call $writer.WriteFieldEnd() + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_UINT16), + .Constant(1), + .Constant(Data2)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_UINT16), + .Constant(1), + .Constant(Data2)); + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()); + .Call $writer.WriteFieldEnd() + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_UINT16), + .Constant(2), + .Constant(Data3)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_UINT16), + .Constant(2), + .Constant(Data3)); + .Call $writer.WriteUInt16(.Call $reader.ReadUInt16()); + .Call $writer.WriteFieldEnd() + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_UINT64), + .Constant(3), + .Constant(Data4)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_UINT64), + .Constant(3), + .Constant(Data4)); + .Call $writer.WriteUInt64(.Call $reader.ReadUInt64()); + .Call $writer.WriteFieldEnd() + } + }; + .Call $writer.WriteStructEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call $writer.WriteFieldEnd() + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(30), + .Constant(_int32Vector)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_LIST), + .Constant(30), + .Constant(_int32Vector)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT32)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Call $writer.WriteInt32(.Call $reader.ReadInt32()); + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call $writer.WriteFieldEnd() + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(40), + .Constant(_nestedVector)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_LIST), + .Constant(40), + .Constant(_nestedVector)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_STRUCT)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block() { + .Call $writer.WriteStructBegin(.Constant(Nested)); + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_DOUBLE), + .Constant(0), + .Constant(_double)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_DOUBLE), + .Constant(0), + .Constant(_double)); + .Call $writer.WriteDouble(.Call $reader.ReadDouble()); + .Call $writer.WriteFieldEnd() + } + }; + .Call $writer.WriteStructEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call $writer.WriteFieldEnd() + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(50), + .Constant(b)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_LIST), + .Constant(50), + .Constant(b)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT8)); + .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call $writer.WriteFieldEnd() + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(51), + .Constant(_blobList)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_LIST), + .Constant(51), + .Constant(_blobList)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_LIST)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT8)); + .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call $writer.WriteFieldEnd() + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(52), + .Constant(_blobVector)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_LIST), + .Constant(52), + .Constant(_blobVector)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_LIST)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT8)); + .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call $writer.WriteFieldEnd() + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_MAP), + .Constant(53), + .Constant(_blobMap)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_MAP), + .Constant(53), + .Constant(_blobMap)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT32), + .Constant(BT_LIST)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Call $writer.WriteInt32(.Call $reader.ReadInt32()); + .Default(System.Void); + .Default(System.Void); + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT8)); + .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call $writer.WriteFieldEnd() + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(54), + .Constant(_blobNullable)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_LIST), + .Constant(54), + .Constant(_blobNullable)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_LIST)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT8)); + .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call $writer.WriteFieldEnd() + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_MAP), + .Constant(60), + .Constant(_map)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_MAP), + .Constant(60), + .Constant(_map)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT32), + .Constant(BT_DOUBLE)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Call $writer.WriteInt32(.Call $reader.ReadInt32()); + .Default(System.Void); + .Default(System.Void); + .Default(System.Void); + .Call $writer.WriteDouble(.Call $reader.ReadDouble()); + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call $writer.WriteFieldEnd() + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(70), + .Constant(_decimal)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_LIST), + .Constant(70), + .Constant(_decimal)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT8)); + .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call $writer.WriteFieldEnd() + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(71), + .Constant(_decList)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_LIST), + .Constant(71), + .Constant(_decList)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_LIST)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT8)); + .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call $writer.WriteFieldEnd() + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(72), + .Constant(_decVector)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_LIST), + .Constant(72), + .Constant(_decVector)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_LIST)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT8)); + .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call $writer.WriteFieldEnd() + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_MAP), + .Constant(73), + .Constant(_decMap)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_MAP), + .Constant(73), + .Constant(_decMap)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT32), + .Constant(BT_LIST)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Call $writer.WriteInt32(.Call $reader.ReadInt32()); + .Default(System.Void); + .Default(System.Void); + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT8)); + .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call $writer.WriteFieldEnd() + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(74), + .Constant(_decNullable)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_LIST), + .Constant(74), + .Constant(_decNullable)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_LIST)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT8)); + .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call $writer.WriteFieldEnd() + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(75), + .Constant(_decimal_req)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_LIST), + .Constant(75), + .Constant(_decimal_req)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT8)); + .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call $writer.WriteFieldEnd() + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(80), + .Constant(_reference)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_LIST), + .Constant(80), + .Constant(_reference)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT8)); + .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call $writer.WriteFieldEnd() + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(81), + .Constant(_refList)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_LIST), + .Constant(81), + .Constant(_refList)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_LIST)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT8)); + .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call $writer.WriteFieldEnd() + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(82), + .Constant(_refVector)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_LIST), + .Constant(82), + .Constant(_refVector)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_LIST)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT8)); + .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call $writer.WriteFieldEnd() + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_MAP), + .Constant(83), + .Constant(_refMap)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_MAP), + .Constant(83), + .Constant(_refMap)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT32), + .Constant(BT_LIST)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Call $writer.WriteInt32(.Call $reader.ReadInt32()); + .Default(System.Void); + .Default(System.Void); + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT8)); + .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call $writer.WriteFieldEnd() + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_LIST), + .Constant(84), + .Constant(_refNullable)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_LIST), + .Constant(84), + .Constant(_refNullable)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_LIST)); + .Loop { + .If ($count-- > 0) { + .Block() { + .Default(System.Void); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block(System.Int32 $count) { + $count = .Call $reader.ReadContainerBegin(); + .Block() { + .Call $writer.WriteContainerBegin( + $count, + .Constant(BT_INT8)); + .Call $writer.WriteBytes(.Call $reader.ReadBytes($count)); + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Default(System.Void) + } + } .Else { + .Break end { } + } + } + .LabelTarget end:; + .Call $writer.WriteContainerEnd() + }; + .Call $reader.ReadContainerEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call $writer.WriteFieldEnd() + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_STRUCT), + .Constant(85), + .Constant(_dt)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_STRUCT), + .Constant(85), + .Constant(_dt)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block() { + .Call $writer.WriteStructBegin(.Constant(Generic)); + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_INT64), + .Constant(0), + .Constant(value)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_INT64), + .Constant(0), + .Constant(value)); + .Call $writer.WriteInt64(.Call $reader.ReadInt64()); + .Call $writer.WriteFieldEnd() + } + }; + .Call $writer.WriteStructEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call $writer.WriteFieldEnd() + } + }; + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_STRUCT), + .Constant(86), + .Constant(_dt2)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_STRUCT), + .Constant(86), + .Constant(_dt2)); + .Block(System.Int32 $depth) { + $depth = .Call Bond.MaxDepthChecker.ValidateDepthForIncrement(); + .Try { + .Block() { + .Call Bond.MaxDepthChecker.SetDepth(.Increment($depth)); + .Block() { + .Call $writer.WriteStructBegin(.Constant(GenericNothing)); + .If ( + .Call $reader.ReadFieldOmitted() + ) { + .Call $writer.WriteFieldOmitted( + .Constant(BT_INT64), + .Constant(0), + .Constant(value)) + } .Else { + .Block() { + .Call $writer.WriteFieldBegin( + .Constant(BT_INT64), + .Constant(0), + .Constant(value)); + .Call $writer.WriteInt64(.Call $reader.ReadInt64()); + .Call $writer.WriteFieldEnd() + } + }; + .Call $writer.WriteStructEnd() + } + } + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } + }; + .Call $writer.WriteFieldEnd() + } + }; + .Call $writer.WriteStructEnd() + } } - }; - .Call $writer.WriteStructEnd() + } .Finally { + .Call Bond.MaxDepthChecker.SetDepth($depth) + } } } \ No newline at end of file diff --git a/cs/test/internal/Internal.csproj b/cs/test/internal/Internal.csproj index 634173625b..4077d2d4f8 100644 --- a/cs/test/internal/Internal.csproj +++ b/cs/test/internal/Internal.csproj @@ -8,7 +8,7 @@ Bond.InternalTest False UnitTest - net45 + net462 diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index f6387940e4..53fd98c2c4 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -90,10 +90,6 @@ if (Haskell_PANDOC_EXECUTABLE AND Doxygen_EXECUTABLE) OPTIONS --self-contained --table-of-contents OUTPUT_DIR manual) - add_pandoc_markdown(src/bond_over_grpc.md - OPTIONS --self-contained --table-of-contents - OUTPUT_DIR manual) - add_pandoc_markdown (src/bond_cs.md CODE "numberLines" OPTIONS --table-of-contents @@ -123,7 +119,6 @@ if (Haskell_PANDOC_EXECUTABLE AND Doxygen_EXECUTABLE) doxygen/bond_layout.xml doxygen/bond_reference.css doxygen/mainpage.md - doxygen/examples/wait_callback_example.cpp ${cpp_headers}) set (doxygen_output_dir diff --git a/doc/doxygen/examples/wait_callback_example.cpp b/doc/doxygen/examples/wait_callback_example.cpp deleted file mode 100644 index 67fe8e92b7..0000000000 --- a/doc/doxygen/examples/wait_callback_example.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include -// ... - -int main() -{ - Example::Client client(/* ... */); - - bond::ext::gRPC::wait_callback cb; - client.AsyncExampleMethod(/* ... */, cb); - - cb.wait(); - if (cb.status().ok()) - { - DoSomeThingWith(cb.response()); - } -} diff --git a/doc/src/bond_cpp.md b/doc/src/bond_cpp.md index 2f5239597e..74a256cd1e 100644 --- a/doc/src/bond_cpp.md +++ b/doc/src/bond_cpp.md @@ -2019,9 +2019,6 @@ References [Python User's Manual][bond_py] ---------------------------- -[Bond-over-gRPC overview][bond_over_grpc] ----------------------------- - [API_reference]: ../reference/cpp/index.html [compiler]: compiler.html @@ -2032,8 +2029,6 @@ References [bond_java]: bond_java.html -[bond_over_grpc]: bond_over_grpc.html - [serializing_transform_ref]: ../reference/cpp/structbond_1_1_serializing_transform.html diff --git a/doc/src/bond_cs.md b/doc/src/bond_cs.md index 1e1377e035..ec38f97ff6 100644 --- a/doc/src/bond_cs.md +++ b/doc/src/bond_cs.md @@ -1695,15 +1695,15 @@ namespace). This table lists which frameworks are targeted by the Bond assemblies. -This table is accurate for Bond NuGet packages 8.2.0 and later. +This table is accurate for Bond NuGet packages 11.0 and later. -| Assembly | .NET 4.0 | .NET 4.5 | .NET 4.6 | .NET Standard 1.0 | .NET Standard 1.3 | .NET Standard 1.6 | -|--------------------------|----------|----------|----------|-------------------|-------------------|-------------------| -| Bond.Attributes.dll | No | Yes | ← | Yes | ← | Yes | -| Bond.Reflection.dll | No | Yes | ← | Yes | ← | Yes | -| Bond.dll | No | Yes | ← | Yes | ← | Yes | -| Bond.JSON.dll | No | Yes | ← | Yes | ← | Yes | -| Bond.IO.dll | No | Win only | Win only | No | Win only | Win only | +| Assembly | .NET 4.5 | .NET 4.6.2 | .NET Standard 1.0 | .NET Standard 1.3 | .NET Standard 1.6 | +|--------------------------|----------|------------|-------------------|-------------------|-------------------| +| Bond.Attributes.dll | No | Yes | Yes | ← | Yes | +| Bond.Reflection.dll | No | Yes | Yes | ← | Yes | +| Bond.dll | No | Yes | Yes | ← | Yes | +| Bond.JSON.dll | No | Yes | Yes | ← | Yes | +| Bond.IO.dll | No | Win only | No | Win only | Win only | A left arrow (←) indicates that support for that framework is provided by the version of the assembly that targets a lower version of the framework. @@ -1720,10 +1720,6 @@ References [Python User's Manual][bond_py] ---------------------------- -[Bond-over-gRPC overview][bond_over_grpc] ----------------------------- - -[bond_over_grpc]: bond_over_grpc.html [bond_cpp]: bond_cpp.html [bond_java]: bond_java.html [bond_py]: bond_py.html diff --git a/doc/src/bond_java.md b/doc/src/bond_java.md index a0dd73cf87..e74fc6f9f5 100644 --- a/doc/src/bond_java.md +++ b/doc/src/bond_java.md @@ -605,9 +605,11 @@ build and install the Bond compiler. Follow the instructions in the top-level [README.md](https://github.com/microsoft/bond/blob/master/README.md) to do all of this. -Java has two additional requirements: +Java has additional requirements: -* The Bond compiler, `gbc`, must be in your `PATH`. +* A Java 8 JDK. A link to download an appropriate OpenJDK 8 is available from https://learn.microsoft.com/en-us/java/openjdk/download. + +* The Bond compiler, `gbc`, must be in your `PATH`. `gbc` is produced as part of the C++ build, so you'll need to follow those instructions, and then ensure the resulting binary is on your path: * Linux, macOS: The `make install` step in the `README` will take care of this. If you don't want to install Bond into system directories, you can add @@ -620,8 +622,11 @@ Java has two additional requirements: "%PATH%;\build\compiler\build\gbc"`, where `` is the directory you cloned Bond into. -* You need the `gradle` build tool, and should get it from the package manager - for your system. Accordingly: +* `maven`. It may be downloaded from https://maven.apache.org/download.cgi + +* The `gradle` build tool. You can download it directly or get it from the package manager + for your system. Note that `gradle` has had multiple breaking changes since this was set + up; gradle 4.7 from https://gradle.org/releases/ has been validated to work. * Ubuntu: `sudo apt install gradle` @@ -643,6 +648,12 @@ To build the library and install it to your local maven repository: cd java/core; gradle build install ``` +That will also run the tests. To re-build and re-run the tests: + +``` +gradle build install --rerun-tasks +``` + To consume either component from your local maven repository, see the [`build.gradle`](https://github.com/microsoft/bond/blob/master/examples/java/core/serialization/build.gradle) in any of our Java example projects. diff --git a/doc/src/bond_over_grpc.md b/doc/src/bond_over_grpc.md deleted file mode 100644 index e72b40805d..0000000000 --- a/doc/src/bond_over_grpc.md +++ /dev/null @@ -1,306 +0,0 @@ -% Bond-over-gRPC - -# About # - -Bond-over-gRPC provides code generation from Bond IDL service definitions -to send Bond objects via [gRPC](http://www.grpc.io/). - -**Bond-over-gRPC is deprecated and will be completely removed from Bond in -May 2022.** See GitHub issue [\#1131, Bond-over-gRPC will be deprecated -February 2022](https://github.com/microsoft/bond/issues/1131), for full -details. - -If you are looking for something similar in spirit to Bond-over-gRPC, we recommend the following. - -* For C++, gRPC++ now supports a [callback-based asynchronous - API](https://github.com/grpc/proposal/pull/180) like Bond-over-gRPC’s. - Check out the - [client](https://github.com/grpc/grpc/blob/master/examples/cpp/helloworld/greeter_callback_client.cc) - and - [server](https://github.com/grpc/grpc/blob/master/examples/cpp/helloworld/greeter_callback_server.cc) - examples. -* For C# and .NET, we recommend [gRPC for - .NET](https://github.com/grpc/grpc-dotnet/). The Grpc.Core library that - Bond-over-gRPC is built atop [will no longer be supported as of May - 2022](https://grpc.io/blog/grpc-csharp-future/). -* Both gRPC++ and gRPC for .NET support pluggable serialization formats, so - you can use them with Bond, JSON, Protocol Buffers, or anything else. - -# Features # - -## Defining Services ## - -The Bond IDL has been extended to support the definition of -[services](compiler.html#service-definition) and -[generic services](compiler.html#generic-service). These definitions are -used by the Bond compiler to generate classes that provide: - -* a service base that can be used as the basis for implementing services' - methods -* a proxy stub that can be used by clients to invoke those methods - -To generate these classes, pass the `--grpc` flag to `gbc` (the Bond compiler -tool). - -Note that gRPC doesn't provide a messaging pattern that matches -the semantics of methods with a return type of `nothing`; to compensate, -`gbc` provides generated wrappers to simulate the appropriate semantics. - -Also note that Bond-over-gRPC only provides interfaces for gRPC's streaming -in C#; this functionality will be added to C++ in the coming months. - -# Implementations # - -Bond-over-gRPC is available for C# and C++. - -## Bond-over-gRPC for C# ## - -Given a service definition like the following: - -``` -service Example -{ - ExampleResponse ExampleMethod(ExampleRequest); -} -``` - -`gbc` will generate C# classes for gRPC with the `--grpc` flag: - -``` -gbc c# --grpc example.bond -``` - -The key generated C# classes for gRPC are: - -* A simple class with the name of the service (e.g.: `Example`). This class - provides some basic encapsulation of the server-side service base, the - client-side proxy stub, and some static methods and data members for - initialization. -* The service base, which is named with the name of the service plus the suffix - `Base` (e.g.: `Example.ExampleBase`). This class has abstract methods - for each of the methods defined in the service IDL, serving as a base for the - concrete implementation which will provide the actual server-side business - logic. -* The proxy stub, which is named with the name of the service plus the suffix - `Client' (e.g.: `Example.ExampleClient`). This is used to invoke the service - from the client side. - -To build the service functionality, simply write a concrete service -implementation by subclassing the server base and supplying the business logic: - -```csharp -public class ExampleServiceImpl : Example.ExampleBase -{ - public override async Task> ExampleMethod(IMessage param, ServerCallContext context) - { - ExampleRequest request = param.Payload.Deserialize(); - var response = new ExampleResponse(); - - // Service business logic goes here - - return Message.From(response); - } -} -``` - -This service implementation is hooked up to a gRPC server as follows: - -```csharp -var server = new Grpc.Core.Server -{ - Services = { Example.BindService(new ExampleServiceImpl()) }, - Ports = { new Grpc.Core.ServerPort(ExampleHost, ExamplePort, Grpc.Core.ServerCredentials.Insecure) } -}; -server.Start(); -``` - -At this point the server is ready to receive requests and route them to the -service implementation. - -On the client side, the proxy stub establishes a connection to the server like this: - -```csharp -var channel = new Grpc.Core.Channel(ExampleHost, ExamplePort, Grpc.Core.ChannelCredentials.Insecure); -var client = new Example.ExampleClient(channel); -``` - -The proxy stub can then be used to make calls to the server as follows: - -```csharp -var request = new ExampleRequest(); -// Fill in request fields here - -IMessage responseMessage = await client.Method(request); - -ExampleResponse response = responseMessage.Payload.Deserialize().Payload; -// Examine response here -``` - -Note that the signatures generated by `gbc` are slightly different from the -ones in the gRPC documentation: on the service side, the request is wrapped -in `IMessage` and on the client side, the response is wrapped in -`IMessage`; this allows for better control over the time of -deserialization and also helps prevent slicing when using polymorphic Bond -types. Note also that Bond-over-gRPC does not provide synchronous APIs in C# -by design. - -For more information about gRPC in C#, take a look at the -[gRPC C# tutorial](http://www.grpc.io/docs/tutorials/basic/csharp.html). - -There is a [Bond-over-gRPC standalone example project](https://github.com/microsoft/bond-grpc-examples). - -See also the following example: - - - -- `examples/cs/grpc/pingpong` -- `examples/cs/grpc/streaming` -- `examples/cs/grpc/scalar` -- `examples/cs/grpc/shared-types-assembly` - -## Bond-over-gRPC for C++ ## - -Given a service definition like the following: - -``` -service Example -{ - ExampleResponse ExampleMethod(ExampleRequest); -} -``` - -`gbc` will generate C++ classes for gRPC with the `--grpc` flag: - -``` -gbc c++ --grpc example.bond -``` - -The key generated C++ classes for gRPC are: - -* A simple class with the name of the service (e.g.: `Example`). This class - provides some basic encapsulation of the server-side service base and the - client-side proxy stub. -* The service base, which is an inner class named `Service` (e.g.: - `Example::Service`). This class has abstract methods - for each of the methods defined in the service IDL, serving as a base for the - concrete implementation which will provide the actual server-side business - logic. -* The proxy stub, which is an inner class named `Client` (e.g.: - `Example::Client`). This is used to invoke the service from the - client side. - -To build the service functionality, simply write a concrete service -implementation by subclassing the server base and supplying the business logic: - -```cpp -class ExampleServiceImpl final : public Example::Service -{ -public: - using Example::Service::Service; - -private: - void ExampleMethod( - bond::ext::grpc::unary_call call) override - { - ExampleRequest request = call.request().Deserialize(); - ExampleResponse response; - - // Service business logic goes here - - call.Finish(response); - } -} -``` - -This service implementation is hooked up to a gRPC server as follows: - -```cpp -bond::ext::grpc::thread_pool threadPool; -const std::string server_address{ Host + ":" + Port }; - -std::unique_ptr service{ new ExampleServiceImpl{ threadPool } }; - -grpc::ServerBuilder builder; -builder.AddListeningPort(server_address, grpc::InsecureServerCredentials()); - -auto server = bond::ext::grpc::server::Start(builder, std::move(service)); -``` - -At this point the server is ready to receive requests and route them to the -service implementation. - -On the client side, the proxy stub establishes a connection to the server like this: - -```cpp -auto ioManager = std::make_shared(); -bond::ext::grpc::thread_pool threadPool; -const std::string server_address{ Host + ":" + Port }; - -Example::Client client{ - grpc::CreateChannel(server_address, grpc::InsecureChannelCredentials()), - ioManager, - threadPool }; -``` - -The proxy stub can then be used to make calls to the server as follows: - -```cpp -ExampleRequest request; -// Fill in request fields here - -// Blocking version using std::future -try -{ - ExampleResponse response = client.AsyncExampleMethod(request) - .get().response().Deserialize(); - // Examine response here -} -catch (const bond::ext::grpc::UnaryCallException& e) -{ - // Examine e.status() -} - -// Async version with a callback -client.AsyncExampleMethod( - request, - [](bond::ext::grpc::unary_call_result result) - { - if (result.status().ok()) - { - ExampleResponse response = result.response().Deserialize(); - // Examine response here - } - else - { - // Examine result.status() - } - }); -``` - -Note these APIs are significantly different from the APIs presented in the -gRPC documentation; Bond-over-gRPC is attempting to provide a more -straightforward API for asynchronous communication than gRPC currently -presents in C++. Bond-over-gRPC does not provide synchronous APIs in C++ by -design. - -The proxy stub has a number of overloads for each method. The simplest is -demonstrated above, and there are ones that take `bonded` and -`grpc::ClientContext` arguments. - -Using `bonded` to wrap the request and response objects allows for better -control over the time of deserialization and also helps prevent slicing when -using polymorphic Bond types. As demonstrated above, convenience APIs are -provided in some places to hide the use `bonded` where possible. For use -of `bonded` request objects and `ClientContext` arguments, see the pingpong -example. - -For more information about gRPC in C++, take a look at the -[gRPC C++ tutorial](http://www.grpc.io/docs/tutorials/basic/c.html); -however, keep in mind that the Bond-over-gRPC APIs diverge significantly -from those documented there. - -See also the following example: - -- `examples/cpp/grpc/helloworld` -- `examples/cpp/grpc/pingpong` diff --git a/doc/src/compiler.md b/doc/src/compiler.md index 261048792f..14df3e8772 100644 --- a/doc/src/compiler.md +++ b/doc/src/compiler.md @@ -265,11 +265,9 @@ See example: `examples/cpp/core/schema_view` Service definition ------------------ -**Bond-over-gRPC is deprecated and will be completely removed from Bond in -May 2022.** See GitHub issue [\#1131, Bond-over-gRPC will be deprecated -February 2022](https://github.com/microsoft/bond/issues/1131), for full -details. `gbc` will still be able to parse service definitions and emit them -in JSON AST, but C++ and C# codegen will be removed in May 2022. +As of Bond version 11, services are not supported during codegen nor at +runtime. Service definitions can still appear in .bond files, and gbc be +used to parse service definitions to the JSON AST. A service definition consists of a service name and methods: @@ -314,9 +312,6 @@ For duplex streaming methods, the parameters and results do not have to have a 1:1 correspondence. The server is free to return results at any time during the lifetime of the method invocation. -NB: Streaming methods are currently only supported when generating C# and -using Bond-over-gRPC. - Methods with a result of `nothing` are one-way, fire and forget methods: the service doesn't send any response regardless of whether the service method execution resulted in success or failure. Furthmore, the client will not diff --git a/examples/cs/core/blob/blob.csproj b/examples/cs/core/blob/blob.csproj index 7ddb8bb043..942ab8f7b4 100644 --- a/examples/cs/core/blob/blob.csproj +++ b/examples/cs/core/blob/blob.csproj @@ -7,7 +7,7 @@ Exe blob blob - v4.5 + v4.6.2 AnyCPU diff --git a/examples/cs/core/cloning/cloning.csproj b/examples/cs/core/cloning/cloning.csproj index 279bb8d6b0..e0bc288397 100644 --- a/examples/cs/core/cloning/cloning.csproj +++ b/examples/cs/core/cloning/cloning.csproj @@ -7,7 +7,7 @@ Exe cloning cloning - v4.5 + v4.6.2 AnyCPU diff --git a/examples/cs/core/container_alias/container_alias.csproj b/examples/cs/core/container_alias/container_alias.csproj index 8d7c5e2d6c..cb73d306a4 100644 --- a/examples/cs/core/container_alias/container_alias.csproj +++ b/examples/cs/core/container_alias/container_alias.csproj @@ -7,7 +7,7 @@ Exe container_alias container_alias - v4.5 + v4.6.2 --using="CustomList=Examples.SomeCustomList<{0}>" diff --git a/examples/cs/core/date_time/date_time.csproj b/examples/cs/core/date_time/date_time.csproj index 6300acb459..91bbbafd49 100644 --- a/examples/cs/core/date_time/date_time.csproj +++ b/examples/cs/core/date_time/date_time.csproj @@ -1,4 +1,4 @@ - + @@ -7,7 +7,7 @@ Exe date_time date_time - v4.5 + v4.6.2 --using="DateTime=System.DateTime" diff --git a/examples/cs/core/decimal/decimal.csproj b/examples/cs/core/decimal/decimal.csproj index f6552cb039..22d58a2516 100644 --- a/examples/cs/core/decimal/decimal.csproj +++ b/examples/cs/core/decimal/decimal.csproj @@ -1,4 +1,4 @@ - + @@ -7,7 +7,7 @@ Exe decimal decimal - v4.5 + v4.6.2 --using="decimal=decimal" diff --git a/examples/cs/core/enumerations/enumerations.csproj b/examples/cs/core/enumerations/enumerations.csproj index 6ed6f0750c..02b264606a 100644 --- a/examples/cs/core/enumerations/enumerations.csproj +++ b/examples/cs/core/enumerations/enumerations.csproj @@ -7,7 +7,7 @@ Exe enumerations enumerations - v4.5 + v4.6.2 AnyCPU diff --git a/examples/cs/core/generic_tree/generic_tree.csproj b/examples/cs/core/generic_tree/generic_tree.csproj index 14ce7ceccd..70f94df915 100644 --- a/examples/cs/core/generic_tree/generic_tree.csproj +++ b/examples/cs/core/generic_tree/generic_tree.csproj @@ -7,7 +7,7 @@ Exe generic_tree generic_tree - v4.5 + v4.6.2 AnyCPU diff --git a/examples/cs/core/generics/generics.csproj b/examples/cs/core/generics/generics.csproj index 7a4990cc31..11ac30e296 100644 --- a/examples/cs/core/generics/generics.csproj +++ b/examples/cs/core/generics/generics.csproj @@ -7,7 +7,7 @@ Exe generics generics - v4.5 + v4.6.2 AnyCPU diff --git a/examples/cs/core/guid/guid.csproj b/examples/cs/core/guid/guid.csproj index 79139e0ada..d477a97d83 100644 --- a/examples/cs/core/guid/guid.csproj +++ b/examples/cs/core/guid/guid.csproj @@ -1,4 +1,4 @@ - + @@ -7,7 +7,7 @@ Exe guid guid - v4.5 + v4.6.2 --using="guid_str=System.Guid" --using="guid_bin=System.Guid" diff --git a/examples/cs/core/immutable_collections/immutable_collections.csproj b/examples/cs/core/immutable_collections/immutable_collections.csproj index 67b5449c71..7d9a689daa 100644 --- a/examples/cs/core/immutable_collections/immutable_collections.csproj +++ b/examples/cs/core/immutable_collections/immutable_collections.csproj @@ -5,7 +5,7 @@ Exe immutable_collections immutable_collections - net45 + net462 --using="ImmutableArray=System.Collections.Immutable.ImmutableArray<{0}>" --using="ImmutableList=System.Collections.Immutable.ImmutableList<{0}>" --using="ImmutableHashSet=System.Collections.Immutable.ImmutableHashSet<{0}>" --using="ImmutableSortedSet=System.Collections.Immutable.ImmutableSortedSet<{0}>" --using="ImmutableDictionary=System.Collections.Immutable.ImmutableDictionary<{0},{1}>" --using="ImmutableSortedDictionary=System.Collections.Immutable.ImmutableSortedDictionary<{0},{1}>" diff --git a/examples/cs/core/import/import.csproj b/examples/cs/core/import/import.csproj index 478f42856b..641a15cb7f 100644 --- a/examples/cs/core/import/import.csproj +++ b/examples/cs/core/import/import.csproj @@ -1,4 +1,4 @@ - + @@ -7,7 +7,7 @@ Exe import import - v4.5 + v4.6.2 AnyCPU diff --git a/examples/cs/core/inheritance/inheritance.csproj b/examples/cs/core/inheritance/inheritance.csproj index e5a832724f..1d97d48df8 100644 --- a/examples/cs/core/inheritance/inheritance.csproj +++ b/examples/cs/core/inheritance/inheritance.csproj @@ -7,7 +7,7 @@ Exe inheritance inheritance - v4.5 + v4.6.2 AnyCPU diff --git a/examples/cs/core/marshaling/marshaling.csproj b/examples/cs/core/marshaling/marshaling.csproj index bafdcc33f0..e5236c9a61 100644 --- a/examples/cs/core/marshaling/marshaling.csproj +++ b/examples/cs/core/marshaling/marshaling.csproj @@ -7,7 +7,7 @@ Exe marshaling marshaling - v4.5 + v4.6.2 AnyCPU diff --git a/examples/cs/core/nothing_default/nothing_default.csproj b/examples/cs/core/nothing_default/nothing_default.csproj index aee62a468f..062051688f 100644 --- a/examples/cs/core/nothing_default/nothing_default.csproj +++ b/examples/cs/core/nothing_default/nothing_default.csproj @@ -7,7 +7,7 @@ Exe nothing_default nothing_default - v4.5 + v4.6.2 AnyCPU diff --git a/examples/cs/core/polymorphic_container/polymorphic_container.csproj b/examples/cs/core/polymorphic_container/polymorphic_container.csproj index f2e1b74ba2..4cfeb6d7d5 100644 --- a/examples/cs/core/polymorphic_container/polymorphic_container.csproj +++ b/examples/cs/core/polymorphic_container/polymorphic_container.csproj @@ -1,4 +1,4 @@ - + @@ -7,7 +7,7 @@ Exe generics generics - v4.5 + v4.6.2 AnyCPU diff --git a/examples/cs/core/protocol_transcoding/protocol_transcoding.csproj b/examples/cs/core/protocol_transcoding/protocol_transcoding.csproj index 3f038e6d88..ccd55285fa 100644 --- a/examples/cs/core/protocol_transcoding/protocol_transcoding.csproj +++ b/examples/cs/core/protocol_transcoding/protocol_transcoding.csproj @@ -7,7 +7,7 @@ Exe protocol_transcoding protocol_transcoding - v4.5 + v4.6.2 AnyCPU diff --git a/examples/cs/core/protocol_versions/protocol_versions.csproj b/examples/cs/core/protocol_versions/protocol_versions.csproj index 99f1ad733a..54cff8e401 100644 --- a/examples/cs/core/protocol_versions/protocol_versions.csproj +++ b/examples/cs/core/protocol_versions/protocol_versions.csproj @@ -7,7 +7,7 @@ Exe protocol_versions protocol_versions - v4.5 + v4.6.2 AnyCPU diff --git a/examples/cs/core/record_streaming/record_streaming.csproj b/examples/cs/core/record_streaming/record_streaming.csproj index 998cd4415b..c44eade4b6 100644 --- a/examples/cs/core/record_streaming/record_streaming.csproj +++ b/examples/cs/core/record_streaming/record_streaming.csproj @@ -7,7 +7,7 @@ Exe record_streaming record_streaming - v4.5 + v4.6.2 AnyCPU diff --git a/examples/cs/core/runtime_schema/runtime_schema.csproj b/examples/cs/core/runtime_schema/runtime_schema.csproj index f436020af2..25ced163e5 100644 --- a/examples/cs/core/runtime_schema/runtime_schema.csproj +++ b/examples/cs/core/runtime_schema/runtime_schema.csproj @@ -7,7 +7,7 @@ Exe runtime_schema runtime_schema - v4.5 + v4.6.2 AnyCPU diff --git a/examples/cs/core/schema_view/schema_view.csproj b/examples/cs/core/schema_view/schema_view.csproj index 3d028d1d29..b064716ca9 100644 --- a/examples/cs/core/schema_view/schema_view.csproj +++ b/examples/cs/core/schema_view/schema_view.csproj @@ -7,7 +7,7 @@ Exe schema_view schema_view - v4.5 + v4.6.2 AnyCPU diff --git a/examples/cs/core/serialization/serialization.csproj b/examples/cs/core/serialization/serialization.csproj index e2244cec01..f6ef81df1d 100644 --- a/examples/cs/core/serialization/serialization.csproj +++ b/examples/cs/core/serialization/serialization.csproj @@ -7,7 +7,7 @@ Exe serialization serialization - v4.5 + v4.6.2 AnyCPU diff --git a/examples/cs/core/serializer/serializer.csproj b/examples/cs/core/serializer/serializer.csproj index b4856429bf..7a541b77bd 100644 --- a/examples/cs/core/serializer/serializer.csproj +++ b/examples/cs/core/serializer/serializer.csproj @@ -7,7 +7,7 @@ Exe serializer serializer - v4.5 + v4.6.2 AnyCPU diff --git a/examples/cs/core/simple_json/simple_json.csproj b/examples/cs/core/simple_json/simple_json.csproj index cb18f36896..ab161238fb 100644 --- a/examples/cs/core/simple_json/simple_json.csproj +++ b/examples/cs/core/simple_json/simple_json.csproj @@ -5,7 +5,7 @@ Exe simple_json simple_json - net45 + net462 @@ -17,7 +17,7 @@ - + diff --git a/examples/cs/core/simple_xml/simple_xml.csproj b/examples/cs/core/simple_xml/simple_xml.csproj index 052a6f0421..34cda5e71d 100644 --- a/examples/cs/core/simple_xml/simple_xml.csproj +++ b/examples/cs/core/simple_xml/simple_xml.csproj @@ -7,7 +7,7 @@ Exe simple_xml simple_xml - v4.5 + v4.6.2 AnyCPU diff --git a/examples/cs/core/stream/stream.csproj b/examples/cs/core/stream/stream.csproj index ca1eb07f5c..3f577ed7f9 100644 --- a/examples/cs/core/stream/stream.csproj +++ b/examples/cs/core/stream/stream.csproj @@ -7,7 +7,7 @@ Exe stream stream - v4.5 + v4.6.2 AnyCPU diff --git a/examples/cs/core/untagged_protocols/untagged_protocols.csproj b/examples/cs/core/untagged_protocols/untagged_protocols.csproj index 80ffb9612d..b5fa3d25e2 100644 --- a/examples/cs/core/untagged_protocols/untagged_protocols.csproj +++ b/examples/cs/core/untagged_protocols/untagged_protocols.csproj @@ -7,7 +7,7 @@ Exe untagged_protocols untagged_protocols - v4.5 + v4.6.2 AnyCPU diff --git a/java/core/src/main/java/org/bondlib/BlobBondType.java b/java/core/src/main/java/org/bondlib/BlobBondType.java index ad974be4a5..75ea43840b 100644 --- a/java/core/src/main/java/org/bondlib/BlobBondType.java +++ b/java/core/src/main/java/org/bondlib/BlobBondType.java @@ -92,28 +92,44 @@ protected final void serializeValue(SerializationContext context, Blob value) th @Override protected final Blob deserializeValue(TaggedDeserializationContext context) throws IOException { - context.reader.readListBegin(context.readContainerResult); - if (context.readContainerResult.elementType.value != BondDataType.BT_INT8.value) { - // throws - Throw.raiseContainerElementTypeIsNotCompatibleDeserializationError( - "element", - context.readContainerResult.elementType, - BondDataType.BT_INT8, - this.getFullName()); + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); + + context.reader.readListBegin(context.readContainerResult); + if (context.readContainerResult.elementType.value != BondDataType.BT_INT8.value) { + // throws + Throw.raiseContainerElementTypeIsNotCompatibleDeserializationError( + "element", + context.readContainerResult.elementType, + BondDataType.BT_INT8, + this.getFullName()); + } + final Blob value = new Blob(context.reader.readBytes(context.readContainerResult.count)); + context.reader.readContainerEnd(); + return value; + } + finally { + DeserializerControls.setDepth(currentDepth); } - final Blob value = new Blob(context.reader.readBytes(context.readContainerResult.count)); - context.reader.readContainerEnd(); - return value; } @Override protected final Blob deserializeValue( UntaggedDeserializationContext context, TypeDef typeDef) throws IOException { - final int count = context.reader.readContainerBegin(); - final Blob value = new Blob(context.reader.readBytes(count)); - context.reader.readContainerEnd(); - return value; + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); + + final int count = context.reader.readContainerBegin(); + final Blob value = new Blob(context.reader.readBytes(count)); + context.reader.readContainerEnd(); + return value; + } + finally { + DeserializerControls.setDepth(currentDepth); + } } @Override diff --git a/java/core/src/main/java/org/bondlib/BondedBondType.java b/java/core/src/main/java/org/bondlib/BondedBondType.java index 90305979de..39fcade0f8 100644 --- a/java/core/src/main/java/org/bondlib/BondedBondType.java +++ b/java/core/src/main/java/org/bondlib/BondedBondType.java @@ -158,14 +158,23 @@ protected final Bonded deserializeField( // throws Throw.raiseFieldTypeIsNotCompatibleDeserializationError(context.readFieldResult.type, field); } - Bonded value = null; + + int currentDepth = DeserializerControls.validateDepthForIncrement(); try { - value = this.deserializeValue(context); - } catch (InvalidBondDataException e) { - // throws - Throw.raiseStructFieldSerializationError(true, field, e, null); + DeserializerControls.setDepth(currentDepth + 1); + + Bonded value = null; + try { + value = this.deserializeValue(context); + } catch (InvalidBondDataException e) { + // throws + Throw.raiseStructFieldSerializationError(true, field, e, null); + } + return value; + } + finally { + DeserializerControls.setDepth(currentDepth); } - return value; } @Override diff --git a/java/core/src/main/java/org/bondlib/CompactBinaryReader.java b/java/core/src/main/java/org/bondlib/CompactBinaryReader.java index b402b8e80a..4bf7aea58a 100644 --- a/java/core/src/main/java/org/bondlib/CompactBinaryReader.java +++ b/java/core/src/main/java/org/bondlib/CompactBinaryReader.java @@ -268,8 +268,15 @@ private void skipListContainer() throws IOException { if (elementTypeFixedWidth > 0) { this.reader.skipBytes((long) count * elementTypeFixedWidth); } else { - while (--count >= 0) { - this.skip(elementType); + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); + while (--count >= 0) { + this.skip(elementType); + } + } + finally { + DeserializerControls.setDepth(currentDepth); } } } @@ -285,9 +292,16 @@ private void skipMapContainer() throws IOException { if (keyTypeFixedWidth > 0 && elementTypeFixedWidth > 0) { this.reader.skipBytes((long) count * (keyTypeFixedWidth + elementTypeFixedWidth)); } else { - while (--count >= 0) { - this.skip(keyType); - this.skip(elementType); + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); + while (--count >= 0) { + this.skip(keyType); + this.skip(elementType); + } + } + finally { + DeserializerControls.setDepth(currentDepth); } } } @@ -297,27 +311,34 @@ private void skipStruct() throws IOException { // take advantage of the struct length stored in V2 this.reader.skipBytes(this.reader.readVarUInt32()); } else { - while (true) { - final int raw = UnsignedHelper.asUnsignedInt(this.reader.readInt8()); - BondDataType fieldType = BondDataType.get(raw & 0x1F); - final int embeddedId = raw >>> 5; - if (embeddedId == 6) { - this.reader.skipBytes(1); - } else if (embeddedId == 7) { - this.reader.skipBytes(2); - } - - if (fieldType.value == BondDataType.BT_STOP_BASE.value) { - // don't stop, as there may be more fields following the base struct - continue; - } - - if (fieldType.value == BondDataType.BT_STOP.value) { - // stop, as we've reached then end and there are no more fields - break; + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); + while (true) { + final int raw = UnsignedHelper.asUnsignedInt(this.reader.readInt8()); + BondDataType fieldType = BondDataType.get(raw & 0x1F); + final int embeddedId = raw >>> 5; + if (embeddedId == 6) { + this.reader.skipBytes(1); + } else if (embeddedId == 7) { + this.reader.skipBytes(2); + } + + if (fieldType.value == BondDataType.BT_STOP_BASE.value) { + // don't stop, as there may be more fields following the base struct + continue; + } + + if (fieldType.value == BondDataType.BT_STOP.value) { + // stop, as we've reached then end and there are no more fields + break; + } + + this.skip(fieldType); } - - this.skip(fieldType); + } + finally { + DeserializerControls.setDepth(currentDepth); } } } diff --git a/java/core/src/main/java/org/bondlib/DeserializerControls.java b/java/core/src/main/java/org/bondlib/DeserializerControls.java new file mode 100644 index 0000000000..641ee82e52 --- /dev/null +++ b/java/core/src/main/java/org/bondlib/DeserializerControls.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +package org.bondlib; + +/** + * Provides controls that impact how deserialization behaves. + */ +public final class DeserializerControls { + + private static int maxDepth = 64; + + /** + * Gets the maximum recursion depth allowed. + * + * @return the max depth + */ + public static int getMaxDepth() { + return maxDepth; + } + + /** + * Sets the maximum recursion depth allowed. + * + * @param value the new max depth + * @throws IllegalArgumentException if the argument was zero or negative + */ + public static void setMaxDepth(int value) { + if (value <= 0) { + throw new IllegalArgumentException("Argument value must be positive"); + } + + maxDepth = value; + } + + private final static ThreadLocal currentDepth = new ThreadLocal() { + @Override + protected Integer initialValue() { + return 0; + } + }; + + final static int validateDepthForIncrement() throws InvalidBondDataException { + int depth = currentDepth.get(); + if (depth >= maxDepth) { + throw new InvalidBondDataException("Recursion depth exceeded max depth"); + } + + return depth; + } + + final static void setDepth(int depth) { + currentDepth.set(depth); + } +} diff --git a/java/core/src/main/java/org/bondlib/FastBinaryReader.java b/java/core/src/main/java/org/bondlib/FastBinaryReader.java index df17184ad5..a7537eafbd 100644 --- a/java/core/src/main/java/org/bondlib/FastBinaryReader.java +++ b/java/core/src/main/java/org/bondlib/FastBinaryReader.java @@ -241,8 +241,15 @@ private void skipListContainer() throws IOException { if (elementTypeFixedWidth > 0) { this.reader.skipBytes((long) count * elementTypeFixedWidth); } else { - while (--count >= 0) { - this.skip(elementType); + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); + while (--count >= 0) { + this.skip(elementType); + } + } + finally { + DeserializerControls.setDepth(currentDepth); } } } @@ -258,29 +265,43 @@ private void skipMapContainer() throws IOException { if (keyTypeFixedWidth > 0 && elementTypeFixedWidth > 0) { this.reader.skipBytes((long) count * (keyTypeFixedWidth + elementTypeFixedWidth)); } else { - while (--count >= 0) { - this.skip(keyType); - this.skip(elementType); + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); + while (--count >= 0) { + this.skip(keyType); + this.skip(elementType); + } + } + finally { + DeserializerControls.setDepth(currentDepth); } } } private void skipStruct() throws IOException { - while (true) { - BondDataType fieldType = this.readType(); - - if (fieldType.value == BondDataType.BT_STOP_BASE.value) { - // don't stop, as there may be more fields following the base struct - continue; - } + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); + while (true) { + BondDataType fieldType = this.readType(); + + if (fieldType.value == BondDataType.BT_STOP_BASE.value) { + // don't stop, as there may be more fields following the base struct + continue; + } + + if (fieldType.value == BondDataType.BT_STOP.value) { + // stop, as we've reached then end and there are no more fields + break; + } - if (fieldType.value == BondDataType.BT_STOP.value) { - // stop, as we've reached then end and there are no more fields - break; + this.reader.skipBytes(2); + this.skip(fieldType); } - - this.reader.skipBytes(2); - this.skip(fieldType); + } + finally { + DeserializerControls.setDepth(currentDepth); } } diff --git a/java/core/src/main/java/org/bondlib/ListBondType.java b/java/core/src/main/java/org/bondlib/ListBondType.java index dbf8370acc..ed7b9d9993 100644 --- a/java/core/src/main/java/org/bondlib/ListBondType.java +++ b/java/core/src/main/java/org/bondlib/ListBondType.java @@ -121,49 +121,65 @@ protected final void serializeValue(SerializationContext context, List @Override protected final List deserializeValue(TaggedDeserializationContext context) throws IOException { - context.reader.readListBegin(context.readContainerResult); - if (context.readContainerResult.elementType.value != this.elementType.getBondDataType().value) { - // throws - Throw.raiseContainerElementTypeIsNotCompatibleDeserializationError( - "element", - context.readContainerResult.elementType, - this.elementType.getBondDataType(), - this.getFullName()); - } + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); - // store count in a local variable since readContainerResult may be modified - // if there are nested containers and thus can't be used inside the loop - final int count = context.readContainerResult.count; - final List value = newDefaultValue(); - for (int i = 0; i < count; ++i) { - try { - TElement element = this.elementType.deserializeValue(context); - value.add(element); - } catch (InvalidBondDataException e) { - Throw.raiseListContainerElementSerializationError(true, false, this.getFullName(), i, e, null); + context.reader.readListBegin(context.readContainerResult); + if (context.readContainerResult.elementType.value != this.elementType.getBondDataType().value) { + // throws + Throw.raiseContainerElementTypeIsNotCompatibleDeserializationError( + "element", + context.readContainerResult.elementType, + this.elementType.getBondDataType(), + this.getFullName()); } + + // store count in a local variable since readContainerResult may be modified + // if there are nested containers and thus can't be used inside the loop + final int count = context.readContainerResult.count; + final List value = newDefaultValue(); + for (int i = 0; i < count; ++i) { + try { + TElement element = this.elementType.deserializeValue(context); + value.add(element); + } catch (InvalidBondDataException e) { + Throw.raiseListContainerElementSerializationError(true, false, this.getFullName(), i, e, null); + } + } + context.reader.readContainerEnd(); + return value; + } + finally { + DeserializerControls.setDepth(currentDepth); } - context.reader.readContainerEnd(); - return value; } @Override protected final List deserializeValue( UntaggedDeserializationContext context, TypeDef typeDef) throws IOException { - final int count = context.reader.readContainerBegin(); - final List value = newDefaultValue(); - final TypeDef elementType = typeDef.element; - for (int i = 0; i < count; ++i) { - try { - TElement element = this.elementType.deserializeValue(context, elementType); - value.add(element); - } catch (InvalidBondDataException e) { - Throw.raiseListContainerElementSerializationError(true, false, this.getFullName(), i, e, null); + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); + + final int count = context.reader.readContainerBegin(); + final List value = newDefaultValue(); + final TypeDef elementType = typeDef.element; + for (int i = 0; i < count; ++i) { + try { + TElement element = this.elementType.deserializeValue(context, elementType); + value.add(element); + } catch (InvalidBondDataException e) { + Throw.raiseListContainerElementSerializationError(true, false, this.getFullName(), i, e, null); + } } + context.reader.readContainerEnd(); + return value; + } + finally { + DeserializerControls.setDepth(currentDepth); } - context.reader.readContainerEnd(); - return value; } @Override @@ -191,19 +207,27 @@ protected final void serializeField( protected final List deserializeField( TaggedDeserializationContext context, StructBondType.StructField> field) throws IOException { - // a list value may be deserialized only from BT_LIST - if (context.readFieldResult.type.value != BondDataType.BT_LIST.value) { - // throws - Throw.raiseFieldTypeIsNotCompatibleDeserializationError(context.readFieldResult.type, field); - } - List value = null; + int currentDepth = DeserializerControls.validateDepthForIncrement(); try { - value = this.deserializeValue(context); - } catch (InvalidBondDataException e) { - // throws - Throw.raiseStructFieldSerializationError(true, field, e, null); + DeserializerControls.setDepth(currentDepth + 1); + + // a list value may be deserialized only from BT_LIST + if (context.readFieldResult.type.value != BondDataType.BT_LIST.value) { + // throws + Throw.raiseFieldTypeIsNotCompatibleDeserializationError(context.readFieldResult.type, field); + } + List value = null; + try { + value = this.deserializeValue(context); + } catch (InvalidBondDataException e) { + // throws + Throw.raiseStructFieldSerializationError(true, field, e, null); + } + return value; + } + finally { + DeserializerControls.setDepth(currentDepth); } - return value; } @Override diff --git a/java/core/src/main/java/org/bondlib/MapBondType.java b/java/core/src/main/java/org/bondlib/MapBondType.java index df48257f7d..fdc4122f89 100644 --- a/java/core/src/main/java/org/bondlib/MapBondType.java +++ b/java/core/src/main/java/org/bondlib/MapBondType.java @@ -139,72 +139,88 @@ protected final void serializeValue(SerializationContext context, Map deserializeValue(TaggedDeserializationContext context) throws IOException { - context.reader.readMapBegin(context.readContainerResult); - if (context.readContainerResult.keyType.value != this.keyType.getBondDataType().value) { - // throws - Throw.raiseContainerElementTypeIsNotCompatibleDeserializationError( - "map key", - context.readContainerResult.keyType, - this.keyType.getBondDataType(), - this.getFullName()); - } - if (context.readContainerResult.elementType.value != this.valueType.getBondDataType().value) { - // throws - Throw.raiseContainerElementTypeIsNotCompatibleDeserializationError( - "mapped value", - context.readContainerResult.elementType, - this.valueType.getBondDataType(), - this.getFullName()); - } + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); - // store count in a local variable since readContainerResult may be modified - // if there are nested containers and thus can't be used inside the loop - final int count = context.readContainerResult.count; - final Map value = newDefaultValue(); - for (int i = 0; i < count; ++i) { - TKey mapEntryKey = null; - try { - mapEntryKey = this.keyType.deserializeValue(context); - } catch (InvalidBondDataException e) { - Throw.raiseMapContainerElementSerializationError(true, this.getFullName(), i, null, e, null); + context.reader.readMapBegin(context.readContainerResult); + if (context.readContainerResult.keyType.value != this.keyType.getBondDataType().value) { + // throws + Throw.raiseContainerElementTypeIsNotCompatibleDeserializationError( + "map key", + context.readContainerResult.keyType, + this.keyType.getBondDataType(), + this.getFullName()); } - TValue mapEntryValue = null; - try { - mapEntryValue = this.valueType.deserializeValue(context); - } catch (InvalidBondDataException e) { - Throw.raiseMapContainerElementSerializationError(true, this.getFullName(), i, mapEntryKey, e, null); + if (context.readContainerResult.elementType.value != this.valueType.getBondDataType().value) { + // throws + Throw.raiseContainerElementTypeIsNotCompatibleDeserializationError( + "mapped value", + context.readContainerResult.elementType, + this.valueType.getBondDataType(), + this.getFullName()); + } + + // store count in a local variable since readContainerResult may be modified + // if there are nested containers and thus can't be used inside the loop + final int count = context.readContainerResult.count; + final Map value = newDefaultValue(); + for (int i = 0; i < count; ++i) { + TKey mapEntryKey = null; + try { + mapEntryKey = this.keyType.deserializeValue(context); + } catch (InvalidBondDataException e) { + Throw.raiseMapContainerElementSerializationError(true, this.getFullName(), i, null, e, null); + } + TValue mapEntryValue = null; + try { + mapEntryValue = this.valueType.deserializeValue(context); + } catch (InvalidBondDataException e) { + Throw.raiseMapContainerElementSerializationError(true, this.getFullName(), i, mapEntryKey, e, null); + } + value.put(mapEntryKey, mapEntryValue); } - value.put(mapEntryKey, mapEntryValue); + context.reader.readContainerEnd(); + return value; + } + finally { + DeserializerControls.setDepth(currentDepth); } - context.reader.readContainerEnd(); - return value; } @Override protected final Map deserializeValue( UntaggedDeserializationContext context, TypeDef typeDef) throws IOException { - final int count = context.reader.readContainerBegin(); - final Map value = newDefaultValue(); - final TypeDef keyType = typeDef.key; - final TypeDef valueType = typeDef.element; - for (int i = 0; i < count; ++i) { - TKey mapEntryKey = null; - try { - mapEntryKey = this.keyType.deserializeValue(context, keyType); - } catch (InvalidBondDataException e) { - Throw.raiseMapContainerElementSerializationError(true, this.getFullName(), i, null, e, null); - } - TValue mapEntryValue = null; - try { - mapEntryValue = this.valueType.deserializeValue(context, valueType); - } catch (InvalidBondDataException e) { - Throw.raiseMapContainerElementSerializationError(true, this.getFullName(), i, mapEntryKey, e, null); + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); + + final int count = context.reader.readContainerBegin(); + final Map value = newDefaultValue(); + final TypeDef keyType = typeDef.key; + final TypeDef valueType = typeDef.element; + for (int i = 0; i < count; ++i) { + TKey mapEntryKey = null; + try { + mapEntryKey = this.keyType.deserializeValue(context, keyType); + } catch (InvalidBondDataException e) { + Throw.raiseMapContainerElementSerializationError(true, this.getFullName(), i, null, e, null); + } + TValue mapEntryValue = null; + try { + mapEntryValue = this.valueType.deserializeValue(context, valueType); + } catch (InvalidBondDataException e) { + Throw.raiseMapContainerElementSerializationError(true, this.getFullName(), i, mapEntryKey, e, null); + } + value.put(mapEntryKey, mapEntryValue); } - value.put(mapEntryKey, mapEntryValue); + context.reader.readContainerEnd(); + return value; + } + finally { + DeserializerControls.setDepth(currentDepth); } - context.reader.readContainerEnd(); - return value; } @Override @@ -232,19 +248,27 @@ protected final void serializeField( protected final Map deserializeField( TaggedDeserializationContext context, StructBondType.StructField> field) throws IOException { - // a map value may be deserialized only from BT_MAP - if (context.readFieldResult.type.value != BondDataType.BT_MAP.value) { - // throws - Throw.raiseFieldTypeIsNotCompatibleDeserializationError(context.readFieldResult.type, field); - } - Map value = null; + int currentDepth = DeserializerControls.validateDepthForIncrement(); try { - value = this.deserializeValue(context); - } catch (InvalidBondDataException e) { - // throws - Throw.raiseStructFieldSerializationError(true, field, e, null); + DeserializerControls.setDepth(currentDepth + 1); + + // a map value may be deserialized only from BT_MAP + if (context.readFieldResult.type.value != BondDataType.BT_MAP.value) { + // throws + Throw.raiseFieldTypeIsNotCompatibleDeserializationError(context.readFieldResult.type, field); + } + Map value = null; + try { + value = this.deserializeValue(context); + } catch (InvalidBondDataException e) { + // throws + Throw.raiseStructFieldSerializationError(true, field, e, null); + } + return value; + } + finally { + DeserializerControls.setDepth(currentDepth); } - return value; } @Override diff --git a/java/core/src/main/java/org/bondlib/NullableBondType.java b/java/core/src/main/java/org/bondlib/NullableBondType.java index 29b9c1879d..75e9b47c17 100644 --- a/java/core/src/main/java/org/bondlib/NullableBondType.java +++ b/java/core/src/main/java/org/bondlib/NullableBondType.java @@ -99,41 +99,57 @@ protected final void serializeValue(SerializationContext context, TValue value) @Override protected final TValue deserializeValue(TaggedDeserializationContext context) throws IOException { - context.reader.readListBegin(context.readContainerResult); - if (context.readContainerResult.elementType.value != this.valueType.getBondDataType().value) { - // throws - Throw.raiseContainerElementTypeIsNotCompatibleDeserializationError( - "value", - context.readContainerResult.elementType, - this.valueType.getBondDataType(), - this.getFullName()); + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); + + context.reader.readListBegin(context.readContainerResult); + if (context.readContainerResult.elementType.value != this.valueType.getBondDataType().value) { + // throws + Throw.raiseContainerElementTypeIsNotCompatibleDeserializationError( + "value", + context.readContainerResult.elementType, + this.valueType.getBondDataType(), + this.getFullName()); + } + TValue value = null; + if (context.readContainerResult.count == 1) { + value = this.valueType.deserializeValue(context); + } else if (context.readContainerResult.count > 1){ + // throws + Throw.raiseNullableListValueHasMultipleElementsDeserializationError(this.getFullName()); + } + context.reader.readContainerEnd(); + return value; } - TValue value = null; - if (context.readContainerResult.count == 1) { - value = this.valueType.deserializeValue(context); - } else if (context.readContainerResult.count > 1){ - // throws - Throw.raiseNullableListValueHasMultipleElementsDeserializationError(this.getFullName()); + finally { + DeserializerControls.setDepth(currentDepth); } - context.reader.readContainerEnd(); - return value; } @Override protected final TValue deserializeValue( UntaggedDeserializationContext context, TypeDef typeDef) throws IOException { - TValue value = null; - final int count = context.reader.readContainerBegin(); - // If count == 0, all we need to do is return null. - if (count == 1) { - value = this.valueType.deserializeValue(context, typeDef.element); - } else if (count > 1) { - // throws - Throw.raiseNullableListValueHasMultipleElementsDeserializationError(this.getFullName()); + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); + + TValue value = null; + final int count = context.reader.readContainerBegin(); + // If count == 0, all we need to do is return null. + if (count == 1) { + value = this.valueType.deserializeValue(context, typeDef.element); + } else if (count > 1) { + // throws + Throw.raiseNullableListValueHasMultipleElementsDeserializationError(this.getFullName()); + } + context.reader.readContainerEnd(); + return value; + } + finally { + DeserializerControls.setDepth(currentDepth); } - context.reader.readContainerEnd(); - return value; } @Override @@ -159,19 +175,27 @@ protected final void serializeField( protected final TValue deserializeField( TaggedDeserializationContext context, StructBondType.StructField field) throws IOException { - // a nullable value may be deserialized only from BT_LIST - if (context.readFieldResult.type.value != BondDataType.BT_LIST.value) { - // throws - Throw.raiseFieldTypeIsNotCompatibleDeserializationError(context.readFieldResult.type, field); - } - TValue value = null; + int currentDepth = DeserializerControls.validateDepthForIncrement(); try { - value = this.deserializeValue(context); - } catch (InvalidBondDataException e) { - // throws - Throw.raiseStructFieldSerializationError(true, field, e, null); + DeserializerControls.setDepth(currentDepth + 1); + + // a nullable value may be deserialized only from BT_LIST + if (context.readFieldResult.type.value != BondDataType.BT_LIST.value) { + // throws + Throw.raiseFieldTypeIsNotCompatibleDeserializationError(context.readFieldResult.type, field); + } + TValue value = null; + try { + value = this.deserializeValue(context); + } catch (InvalidBondDataException e) { + // throws + Throw.raiseStructFieldSerializationError(true, field, e, null); + } + return value; + } + finally { + DeserializerControls.setDepth(currentDepth); } - return value; } @Override diff --git a/java/core/src/main/java/org/bondlib/SetBondType.java b/java/core/src/main/java/org/bondlib/SetBondType.java index 238415f247..0a0c1d9e35 100644 --- a/java/core/src/main/java/org/bondlib/SetBondType.java +++ b/java/core/src/main/java/org/bondlib/SetBondType.java @@ -121,49 +121,65 @@ protected final void serializeValue(SerializationContext context, Set @Override protected final Set deserializeValue(TaggedDeserializationContext context) throws IOException { - context.reader.readListBegin(context.readContainerResult); - if (context.readContainerResult.elementType.value != this.elementType.getBondDataType().value) { - // throws - Throw.raiseContainerElementTypeIsNotCompatibleDeserializationError( - "element", - context.readContainerResult.elementType, - this.elementType.getBondDataType(), - this.getFullName()); - } + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); - // store count in a local variable since readContainerResult may be modified - // if there are nested containers and thus can't be used inside the loop - final int count = context.readContainerResult.count; - final Set value = this.newDefaultValue(); - for (int i = 0; i < count; ++i) { - try { - TElement element = this.elementType.deserializeValue(context); - value.add(element); - } catch (InvalidBondDataException e) { - Throw.raiseListContainerElementSerializationError(true, true, this.getFullName(), i, e, null); + context.reader.readListBegin(context.readContainerResult); + if (context.readContainerResult.elementType.value != this.elementType.getBondDataType().value) { + // throws + Throw.raiseContainerElementTypeIsNotCompatibleDeserializationError( + "element", + context.readContainerResult.elementType, + this.elementType.getBondDataType(), + this.getFullName()); } + + // store count in a local variable since readContainerResult may be modified + // if there are nested containers and thus can't be used inside the loop + final int count = context.readContainerResult.count; + final Set value = this.newDefaultValue(); + for (int i = 0; i < count; ++i) { + try { + TElement element = this.elementType.deserializeValue(context); + value.add(element); + } catch (InvalidBondDataException e) { + Throw.raiseListContainerElementSerializationError(true, true, this.getFullName(), i, e, null); + } + } + context.reader.readContainerEnd(); + return value; + } + finally { + DeserializerControls.setDepth(currentDepth); } - context.reader.readContainerEnd(); - return value; } @Override protected final Set deserializeValue( UntaggedDeserializationContext context, TypeDef typeDef) throws IOException { - final int count = context.reader.readContainerBegin(); - final Set value = newDefaultValue(); - final TypeDef elementType = typeDef.element; - for (int i = 0; i < count; ++i) { - try { - TElement element = this.elementType.deserializeValue(context, elementType); - value.add(element); - } catch (InvalidBondDataException e) { - Throw.raiseListContainerElementSerializationError(true, true, this.getFullName(), i, e, null); + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); + + final int count = context.reader.readContainerBegin(); + final Set value = newDefaultValue(); + final TypeDef elementType = typeDef.element; + for (int i = 0; i < count; ++i) { + try { + TElement element = this.elementType.deserializeValue(context, elementType); + value.add(element); + } catch (InvalidBondDataException e) { + Throw.raiseListContainerElementSerializationError(true, true, this.getFullName(), i, e, null); + } } + context.reader.readContainerEnd(); + return value; + } + finally { + DeserializerControls.setDepth(currentDepth); } - context.reader.readContainerEnd(); - return value; } @Override @@ -191,19 +207,27 @@ protected final void serializeField( protected final Set deserializeField( TaggedDeserializationContext context, StructBondType.StructField> field) throws IOException { - // a set value may be deserialized only from BT_SET - if (context.readFieldResult.type.value != BondDataType.BT_SET.value) { - // throws - Throw.raiseFieldTypeIsNotCompatibleDeserializationError(context.readFieldResult.type, field); - } - Set value = null; + int currentDepth = DeserializerControls.validateDepthForIncrement(); try { - value = this.deserializeValue(context); - } catch (InvalidBondDataException e) { - // throws - Throw.raiseStructFieldSerializationError(true, field, e, null); + DeserializerControls.setDepth(currentDepth + 1); + + // a set value may be deserialized only from BT_SET + if (context.readFieldResult.type.value != BondDataType.BT_SET.value) { + // throws + Throw.raiseFieldTypeIsNotCompatibleDeserializationError(context.readFieldResult.type, field); + } + Set value = null; + try { + value = this.deserializeValue(context); + } catch (InvalidBondDataException e) { + // throws + Throw.raiseStructFieldSerializationError(true, field, e, null); + } + return value; + } + finally { + DeserializerControls.setDepth(currentDepth); } - return value; } @Override diff --git a/java/core/src/main/java/org/bondlib/SimpleBinaryReader.java b/java/core/src/main/java/org/bondlib/SimpleBinaryReader.java index e7651898e3..f94fd12d1d 100644 --- a/java/core/src/main/java/org/bondlib/SimpleBinaryReader.java +++ b/java/core/src/main/java/org/bondlib/SimpleBinaryReader.java @@ -241,33 +241,54 @@ public void skip(SchemaDef schemaDef, TypeDef type) throws IOException { int count = readLength(); skipBytes(count); } else { - final StructDef structDef = schemaDef.structs.get(type.struct_def); - final TypeDef baseDef = structDef.base_def; - if (baseDef != null) { - skip(schemaDef, baseDef); + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); + final StructDef structDef = schemaDef.structs.get(type.struct_def); + final TypeDef baseDef = structDef.base_def; + if (baseDef != null) { + skip(schemaDef, baseDef); + } + for (final org.bondlib.FieldDef field : structDef.fields) { + skip(schemaDef, field.type); + } } - for (final org.bondlib.FieldDef field : structDef.fields) { - skip(schemaDef, field.type); + finally { + DeserializerControls.setDepth(currentDepth); } } break; case BondDataType.Values.BT_LIST: case BondDataType.Values.BT_SET: { - int numElems = readLength(); - final TypeDef elementTypeDef = type.element; - for (int i = 0; i < numElems; i++) { - skip(schemaDef, elementTypeDef); + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); + int numElems = readLength(); + final TypeDef elementTypeDef = type.element; + for (int i = 0; i < numElems; i++) { + skip(schemaDef, elementTypeDef); + } + } + finally { + DeserializerControls.setDepth(currentDepth); } break; } case BondDataType.Values.BT_MAP: { - int numElems = readLength(); - final TypeDef keyTypeDef = type.key; - final TypeDef valueTypeDef = type.element; - for (int i = 0; i < numElems; i++) { - skip(schemaDef, keyTypeDef); - skip(schemaDef, valueTypeDef); + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); + int numElems = readLength(); + final TypeDef keyTypeDef = type.key; + final TypeDef valueTypeDef = type.element; + for (int i = 0; i < numElems; i++) { + skip(schemaDef, keyTypeDef); + skip(schemaDef, valueTypeDef); + } + } + finally { + DeserializerControls.setDepth(currentDepth); } break; } diff --git a/java/core/src/main/java/org/bondlib/StructBondType.java b/java/core/src/main/java/org/bondlib/StructBondType.java index 341ede91dc..082c70695b 100644 --- a/java/core/src/main/java/org/bondlib/StructBondType.java +++ b/java/core/src/main/java/org/bondlib/StructBondType.java @@ -370,44 +370,76 @@ private void serializeValueAsBase( @Override protected final TStruct deserializeValue(TaggedDeserializationContext context) throws IOException { - TStruct value = this.newDefaultValue(); - context.reader.readStructBegin(); - if (this.baseStructType != null) { - this.baseStructType.deserializeValueAsBase(context, value); + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); + + TStruct value = this.newDefaultValue(); + context.reader.readStructBegin(); + if (this.baseStructType != null) { + this.baseStructType.deserializeValueAsBase(context, value); + } + this.deserializeStructFields(context, value); + context.reader.readStructEnd(); + return value; + } + finally { + DeserializerControls.setDepth(currentDepth); } - this.deserializeStructFields(context, value); - context.reader.readStructEnd(); - return value; } private void deserializeValueAsBase(TaggedDeserializationContext context, TStruct value) throws IOException { - if (this.baseStructType != null) { - this.baseStructType.deserializeValueAsBase(context, value); + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); + + if (this.baseStructType != null) { + this.baseStructType.deserializeValueAsBase(context, value); + } + context.reader.readBaseBegin(); + this.deserializeStructFields(context, value); + context.reader.readBaseEnd(); + } + finally { + DeserializerControls.setDepth(currentDepth); } - context.reader.readBaseBegin(); - this.deserializeStructFields(context, value); - context.reader.readBaseEnd(); } @Override protected final TStruct deserializeValue( UntaggedDeserializationContext context, TypeDef typeDef) throws IOException { - TStruct value = this.newDefaultValue(); - this.deserializeValue(context, typeDef, value); - return value; + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); + + TStruct value = this.newDefaultValue(); + this.deserializeValue(context, typeDef, value); + return value; + } + finally { + DeserializerControls.setDepth(currentDepth); + } } private void deserializeValue( UntaggedDeserializationContext context, TypeDef typeDef, TStruct value) throws IOException { - final StructDef structDef = context.schema.structs.get(typeDef.struct_def); - if (this.baseStructType != null) { - final TypeDef baseDef = structDef.base_def; - this.baseStructType.deserializeValue(context, baseDef, value); + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); + + final StructDef structDef = context.schema.structs.get(typeDef.struct_def); + if (this.baseStructType != null) { + final TypeDef baseDef = structDef.base_def; + this.baseStructType.deserializeValue(context, baseDef, value); + } + this.deserializeStructFields(context, structDef, value); + } + finally { + DeserializerControls.setDepth(currentDepth); } - this.deserializeStructFields(context, structDef, value); } @Override diff --git a/java/core/src/main/java/org/bondlib/VectorBondType.java b/java/core/src/main/java/org/bondlib/VectorBondType.java index 53c965ae8e..1796f44e9c 100644 --- a/java/core/src/main/java/org/bondlib/VectorBondType.java +++ b/java/core/src/main/java/org/bondlib/VectorBondType.java @@ -127,49 +127,65 @@ protected final void serializeValue(SerializationContext context, List @Override protected final List deserializeValue(TaggedDeserializationContext context) throws IOException { - context.reader.readListBegin(context.readContainerResult); - if (context.readContainerResult.elementType.value != this.elementType.getBondDataType().value) { - // throws - Throw.raiseContainerElementTypeIsNotCompatibleDeserializationError( - "element", - context.readContainerResult.elementType, - this.elementType.getBondDataType(), - this.getFullName()); - } + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); - // store count in a local variable since readContainerResult may be modified - // if there are nested containers and thus can't be used inside the loop - final int count = context.readContainerResult.count; - final List value = newDefaultValue(count); - for (int i = 0; i < count; ++i) { - try { - TElement element = this.elementType.deserializeValue(context); - value.add(element); - } catch (InvalidBondDataException e) { - Throw.raiseListContainerElementSerializationError(true, false, this.getFullName(), i, e, null); + context.reader.readListBegin(context.readContainerResult); + if (context.readContainerResult.elementType.value != this.elementType.getBondDataType().value) { + // throws + Throw.raiseContainerElementTypeIsNotCompatibleDeserializationError( + "element", + context.readContainerResult.elementType, + this.elementType.getBondDataType(), + this.getFullName()); } + + // store count in a local variable since readContainerResult may be modified + // if there are nested containers and thus can't be used inside the loop + final int count = context.readContainerResult.count; + final List value = newDefaultValue(count); + for (int i = 0; i < count; ++i) { + try { + TElement element = this.elementType.deserializeValue(context); + value.add(element); + } catch (InvalidBondDataException e) { + Throw.raiseListContainerElementSerializationError(true, false, this.getFullName(), i, e, null); + } + } + context.reader.readContainerEnd(); + return value; + } + finally { + DeserializerControls.setDepth(currentDepth); } - context.reader.readContainerEnd(); - return value; } @Override protected final List deserializeValue( UntaggedDeserializationContext context, TypeDef typeDef) throws IOException { - final int count = context.reader.readContainerBegin(); - final List value = newDefaultValue(count); - final TypeDef elementType = typeDef.element; - for (int i = 0; i < count; ++i) { - try { - TElement element = this.elementType.deserializeValue(context, elementType); - value.add(element); - } catch (InvalidBondDataException e) { - Throw.raiseListContainerElementSerializationError(true, false, this.getFullName(), i, e, null); + int currentDepth = DeserializerControls.validateDepthForIncrement(); + try { + DeserializerControls.setDepth(currentDepth + 1); + + final int count = context.reader.readContainerBegin(); + final List value = newDefaultValue(count); + final TypeDef elementType = typeDef.element; + for (int i = 0; i < count; ++i) { + try { + TElement element = this.elementType.deserializeValue(context, elementType); + value.add(element); + } catch (InvalidBondDataException e) { + Throw.raiseListContainerElementSerializationError(true, false, this.getFullName(), i, e, null); + } } + context.reader.readContainerEnd(); + return value; + } + finally { + DeserializerControls.setDepth(currentDepth); } - context.reader.readContainerEnd(); - return value; } @Override @@ -197,19 +213,27 @@ protected final void serializeField( protected final List deserializeField( TaggedDeserializationContext context, StructBondType.StructField> field) throws IOException { - // a list value may be deserialized only from BT_LIST - if (context.readFieldResult.type.value != BondDataType.BT_LIST.value) { - // throws - Throw.raiseFieldTypeIsNotCompatibleDeserializationError(context.readFieldResult.type, field); - } - List value = null; + int currentDepth = DeserializerControls.validateDepthForIncrement(); try { - value = this.deserializeValue(context); - } catch (InvalidBondDataException e) { - // throws - Throw.raiseStructFieldSerializationError(true, field, e, null); + DeserializerControls.setDepth(currentDepth + 1); + + // a list value may be deserialized only from BT_LIST + if (context.readFieldResult.type.value != BondDataType.BT_LIST.value) { + // throws + Throw.raiseFieldTypeIsNotCompatibleDeserializationError(context.readFieldResult.type, field); + } + List value = null; + try { + value = this.deserializeValue(context); + } catch (InvalidBondDataException e) { + // throws + Throw.raiseStructFieldSerializationError(true, field, e, null); + } + return value; + } + finally { + DeserializerControls.setDepth(currentDepth); } - return value; } @Override diff --git a/java/core/src/test/bond/runtimeschema.bond b/java/core/src/test/bond/runtimeschema.bond index 0c620b7dec..b132915303 100644 --- a/java/core/src/test/bond/runtimeschema.bond +++ b/java/core/src/test/bond/runtimeschema.bond @@ -14,3 +14,87 @@ struct RecordV2 { struct FieldRemovedRecord { 1: uint32 tstamp; } + +struct StructWithRecursiveReference +{ + 0: uint32 value; + 1: nullable child; +} + +enum EnumType1 +{ + EnumValue1 = 5, + EnumValue2 = 10, + EnumValue3 = -10, + EnumValue4 = 0x2A, + EnumValue5 = 0XFFFFFFFFFFFFFFF6, //-10 in two's complement + MinInt = -2147483648, +}; + +struct SimpleStruct +{ + 0: uint32 n; + 1: string str; + 2: vector items; +} + +struct NestedStruct1 +{ + 1: required_optional SimpleStruct s; +}; + +struct NestedStruct2 +{ + 1: required_optional NestedStruct1 n1; +}; + +struct NestedStruct3 +{ + 1: required_optional NestedStruct2 n2; +}; + +struct NestedStruct +{ + 1: required_optional NestedStruct3 n3; + 23: required_optional bool m_bool; + 2: required_optional NestedStruct2 n2; + 24: required_optional int8 m_int8; + 3: required_optional NestedStruct1 n1; + 25: required_optional int16 m_int16; + 26: required_optional int32 m_int32; + 27: required_optional int64 m_int64; + 28: required_optional uint8 m_uint8; + 29: required_optional uint16 m_uint16; + 30: required_optional uint32 m_uint32; + 31: required_optional uint64 m_uint64; + 32: required_optional double m_double; + 33: required_optional float m_float; + 34: required_optional EnumType1 m_enum1 = EnumValue1; + 35: required_optional string m_str; +}; + +struct SimpleBase : SimpleStruct +{ + [JsonName("SimpleBase_int32")] + 16: required_optional int32 m_int32; + [JsonName("SimpleBase_enum1")] + 21: required_optional EnumType1 m_enum1 = EnumValue1; +}; + +struct StructWithBase : SimpleBase +{ + [JsonName("StructWithBase_str")] + 0: required_optional string m_str; + [JsonName("StructWithBase_int32")] + 16: required_optional int32 m_int32; + [JsonName("StructWithBase_uint32")] + 17: required_optional uint32 m_uint32; + [JsonName("StructWithBase_uint8")] + 13: required_optional uint8 m_uint8; +}; + +struct NestedWithBase1 +{ + 1: required_optional StructWithBase s1; + 2: required_optional StructWithBase s2; +}; \ No newline at end of file diff --git a/java/core/src/test/java/org/bondlib/DeserializerControlsTest.java b/java/core/src/test/java/org/bondlib/DeserializerControlsTest.java new file mode 100644 index 0000000000..a50bcfe1cc --- /dev/null +++ b/java/core/src/test/java/org/bondlib/DeserializerControlsTest.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +package org.bondlib; + +import org.bondlib.test.*; +import org.junit.Test; + +import java.io.ByteArrayInputStream; +import java.io.EOFException; +import java.io.IOException; +import java.util.Map; +import java.util.AbstractMap; + +import org.junit.Assert; + +public class DeserializerControlsTest { + + @Test(expected = IllegalArgumentException.class) + public void testInvalidSetMaxDepthArguments() { + DeserializerControls.setMaxDepth(-1); + } + + @Test + public void testSetMaxDepthArgumentsRountrip() { + Assert.assertEquals(64, DeserializerControls.getMaxDepth()); + + DeserializerControls.setMaxDepth(1); + Assert.assertEquals(1, DeserializerControls.getMaxDepth()); + + DeserializerControls.setMaxDepth(64); + Assert.assertEquals(64, DeserializerControls.getMaxDepth()); + } + + @Test(expected = InvalidBondDataException.class) + public void test_BadPayload_RecursionViaNesting_Throws() throws IOException + { + // Manually-constructed payload with a nesting depth of n + int n = 100; + byte[] bytes = new byte[8 * n]; + for (int i = 0; i < n; i++) bytes[8 * i + 4] = 1; + + SimpleBinaryReader reader = new SimpleBinaryReader(new ByteArrayInputStream(bytes), 1); + new Deserializer(StructWithRecursiveReference.BOND_TYPE).deserialize(reader); + } + + @Test + public void test_BadPayload_RecursionViaSkip_FastBinary_Throws() throws IOException + { + byte[][] payloads = new byte[][] { + // Depth 130, BT_STRUCT + new byte[] { (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x0A, (byte)0x32, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00 }, + // Depth 130, BT_LIST + new byte[] { (byte)0x0B, (byte)0x32, (byte)0x00, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x64, (byte)0x00 }, + // Depth 130, BT_SET + new byte[] { (byte)0x0C, (byte)0x32, (byte)0x00, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x64, (byte)0x00 }, + // Depth 130, BT_MAP + new byte[] { (byte)0x0D, (byte)0x32, (byte)0x00, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x32, (byte)0x64, (byte)0x00 }, + }; + + for (byte[] payload : payloads) { + try + { + new Deserializer(NestedWithBase1.BOND_TYPE).deserialize(new FastBinaryReader(new ByteArrayInputStream(payload), 1)); + Assert.assertTrue(false); + } + catch (InvalidBondDataException e) { } + } + } + + @Test + public void test_BadPayload_RecursionViaSkip_CompactBinary_Throws() throws IOException + { + Object[] payloads = new Object[] { + // Depth 130, BT_STRUCT, Protocol v1 + new AbstractMap.SimpleEntry(1, new byte[] { (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0xCA, (byte)0x32, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00 }), + // Depth 130, BT_LIST, Protocol v1 + new AbstractMap.SimpleEntry(1, new byte[] { (byte)0xCB, (byte)0x32, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x0B, (byte)0x01, (byte)0x64, (byte)0x00 }), + // Depth 130, BT_LIST, Protocol v2 + new AbstractMap.SimpleEntry(2, new byte[] { (byte)0x86, (byte)0x01, (byte)0xCB, (byte)0x32, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x4B, (byte)0x64, (byte)0x00 }), + // Depth 130, BT_SET, Protocol v1 + new AbstractMap.SimpleEntry(1, new byte[] { (byte)0xCC, (byte)0x32, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x0C, (byte)0x01, (byte)0x64, (byte)0x00 }), + // Depth 130, BT_SET, Protocol v2 + new AbstractMap.SimpleEntry(2, new byte[] { (byte)0x86, (byte)0x01, (byte)0xCC, (byte)0x32, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x4C, (byte)0x64, (byte)0x00 }), + // Depth 130, BT_MAP, Protocol v1 + new AbstractMap.SimpleEntry(1, new byte[] { (byte)0xCD, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x32, (byte)0x64, (byte)0x00 }), + // Depth 130, BT_MAP, Protocol v2 + new AbstractMap.SimpleEntry(2, new byte[] { (byte)0x8D, (byte)0x04, (byte)0xCD, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x0E, (byte)0x0D, (byte)0x01, (byte)0x32, (byte)0x32, (byte)0x64, (byte)0x00 }), + }; + + for (Object obj : payloads) { + AbstractMap.SimpleEntry payload = (AbstractMap.SimpleEntry)obj; + try + { + new Deserializer(NestedWithBase1.BOND_TYPE).deserialize(new CompactBinaryReader(new ByteArrayInputStream(payload.getValue()), payload.getKey())); + Assert.assertTrue(false); + } + catch (InvalidBondDataException e) { } + } + } + + @Test + public void test_BadPayload_LargeContainerInvalidTypes_FastBinary_Throws() throws IOException + { + byte[][] payloads = new byte[][] { + new byte[] { (byte)0x0b, (byte)0x04, (byte)0x00, (byte)0x1e, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x07, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff }, // BT_LIST<0x1e> + new byte[] { (byte)0x0b, (byte)0x04, (byte)0x00, (byte)0x8d, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x07, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff }, // BT_LIST<0x8d> + new byte[] { (byte)0x0c, (byte)0x04, (byte)0x00, (byte)0x1e, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x07, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff }, // BT_SET<0x1e> + new byte[] { (byte)0x0c, (byte)0x04, (byte)0x00, (byte)0x8d, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x07, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff }, // BT_SET<0x8d> + new byte[] { (byte)0x0d, (byte)0x04, (byte)0x00, (byte)0x1e, (byte)0x07, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x07, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff }, // BT_MAP<0x1e, BT_FLOAT> + new byte[] { (byte)0x0d, (byte)0x04, (byte)0x00, (byte)0x8d, (byte)0x07, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x07, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff }, // BT_MAP<0x8d, BT_FLOAT> + new byte[] { (byte)0x0d, (byte)0x04, (byte)0x00, (byte)0x07, (byte)0x1e, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x07, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff }, // BT_MAP + new byte[] { (byte)0x0d, (byte)0x04, (byte)0x00, (byte)0x07, (byte)0x8d, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x07, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff }, // BT_MAP + }; + + for (byte[] payload : payloads) { + try + { + new Deserializer(NestedStruct.BOND_TYPE).deserialize(new FastBinaryReader(new ByteArrayInputStream(payload), 1)); + Assert.assertTrue(false); + } + catch (InvalidBondDataException e) { } + catch (EOFException e) { } + } + } + + @Test + public void test_BadPayload_LargeContainerInvalidTypes_CompactBinary_Throws() throws IOException + { + byte[][] payloads = new byte[][] { + new byte[] { (byte)0x8b, (byte)0x1e, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x07, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff }, // BT_LIST<0x1e> + new byte[] { (byte)0x8b, (byte)0x8d, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x07, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff }, // BT_LIST<0x8d> + new byte[] { (byte)0x8c, (byte)0x1e, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x07, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff }, // BT_SET<0x1e> + new byte[] { (byte)0x8c, (byte)0x8d, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x07, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff }, // BT_SET<0x8d> + new byte[] { (byte)0x8d, (byte)0x1e, (byte)0x07, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x07, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff }, // BT_MAP<0x1e, BT_FLOAT> + new byte[] { (byte)0x8d, (byte)0x8d, (byte)0x07, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x07, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff }, // BT_MAP<0x8d, BT_FLOAT> + new byte[] { (byte)0x8d, (byte)0x07, (byte)0x1e, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x07, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff }, // BT_MAP + new byte[] { (byte)0x8d, (byte)0x07, (byte)0x8d, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x07, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff }, // BT_MAP + }; + + for (int protocol = 1; protocol <= 2; protocol++) + { + for (byte[] payload : payloads) { + try + { + new Deserializer(NestedStruct.BOND_TYPE).deserialize(new CompactBinaryReader(new ByteArrayInputStream(payload), protocol)); + Assert.assertTrue(false); + } + catch (InvalidBondDataException e) { } + catch (EOFException e) { } + } + } + } +} \ No newline at end of file diff --git a/tools/ci-scripts/linux/build_cs.zsh b/tools/ci-scripts/linux/build_cs.zsh index bc6722c736..fa6a8b6a63 100755 --- a/tools/ci-scripts/linux/build_cs.zsh +++ b/tools/ci-scripts/linux/build_cs.zsh @@ -19,8 +19,8 @@ msbuild /p:Configuration=Debug /m $BOND_ROOT/cs/cs.sln msbuild /p:Configuration=Fields /m $BOND_ROOT/cs/cs.sln mono /root/NUnit.ConsoleRunner/tools/nunit3-console.exe -framework=mono -labels=All \ - $BOND_ROOT/cs/test/core/bin/debug/Properties/net45/Bond.UnitTest.dll \ - $BOND_ROOT/cs/test/core/bin/debug/Fields/net45/Bond.UnitTest.dll \ - $BOND_ROOT/cs/test/coreNS10/bin/debug/Properties/net45/Bond.UnitTestCoreNS10.dll \ - $BOND_ROOT/cs/test/coreNS10/bin/debug/Fields/net45/Bond.UnitTestCoreNS10.dll \ - $BOND_ROOT/cs/test/internal/bin/debug/net45/Bond.InternalTest.dll + $BOND_ROOT/cs/test/core/bin/debug/Properties/net462/Bond.UnitTest.dll \ + $BOND_ROOT/cs/test/core/bin/debug/Fields/net462/Bond.UnitTest.dll \ + $BOND_ROOT/cs/test/coreNS10/bin/debug/Properties/net462/Bond.UnitTestCoreNS10.dll \ + $BOND_ROOT/cs/test/coreNS10/bin/debug/Fields/net462/Bond.UnitTestCoreNS10.dll \ + $BOND_ROOT/cs/test/internal/bin/debug/net462/Bond.InternalTest.dll