Unexpected payload size for non byte aligned payload
mgeisler opened this issue · comments
The following PDL file crashes backends::rust::generate
, even though it passes through the analyzer:
little_endian_packets
struct Foo {
ts_sec: 20,
ts_usec: 32,
_size_(_payload_): 32,
_payload_,
}
Stack trace:
thread '<unnamed>' panicked at 'Unexpected payload size for non byte aligned payload', /home/mgeisler/src/pdl/src/backends/rust/parser.rs:526:17
stack backtrace:
0: begin_panic_handler
at /rustc/b2b34bd83192c3d16c88655158f7d8d612513e88/library/std/src/panicking.rs:593:5
1: panic_fmt
at /rustc/b2b34bd83192c3d16c88655158f7d8d612513e88/library/core/src/panicking.rs:67:14
2: pdl_compiler::backends::rust::parser::FieldParser::add_payload_field
at ./src/backends/rust/parser.rs:526:17
3: pdl_compiler::backends::rust::parser::FieldParser::add
at ./src/backends/rust/parser.rs:77:17
4: pdl_compiler::backends::rust::generate_data_struct
at ./src/backends/rust.rs:236:9
5: pdl_compiler::backends::rust::generate_struct_decl
at ./src/backends/rust.rs:696:38
6: pdl_compiler::backends::rust::generate_decl
at ./src/backends/rust.rs:979:13
7: pdl_compiler::backends::rust::generate::{{closure}}
at ./src/backends/rust.rs:998:53