pdl: Call conforms before attempting to parse
The ‘parse_inner’ method should only be called if the payload actually conforms to the expected size of the packet. We might be able to make this API prettier in the future to avoid this danger. Tag: #feature Bug: 274623973 Test: atest pdl_tests pdl_rust_generator_tests_{le,be} (cherry picked from https://android-review.googlesource.com/q/commit:a36b8ce03646fc9a4fc798beb5e893554890183f) Merged-In: I4144f50cbc7b55a97bc10ef527db654218c63173 Change-Id: I4144f50cbc7b55a97bc10ef527db654218c63173
Showing
- tools/pdl/src/backends/rust/parser.rs 1 addition, 1 deletiontools/pdl/src/backends/rust/parser.rs
- tools/pdl/tests/generated/packet_decl_child_packets_big_endian.rs 2 additions, 2 deletions...l/tests/generated/packet_decl_child_packets_big_endian.rs
- tools/pdl/tests/generated/packet_decl_child_packets_little_endian.rs 2 additions, 2 deletions...ests/generated/packet_decl_child_packets_little_endian.rs
- tools/pdl/tests/generated/packet_decl_grand_children_big_endian.rs 3 additions, 3 deletions.../tests/generated/packet_decl_grand_children_big_endian.rs
- tools/pdl/tests/generated/packet_decl_grand_children_little_endian.rs 3 additions, 3 deletions...sts/generated/packet_decl_grand_children_little_endian.rs
Loading
Please register or sign in to comment