From 1a7662d3d45ea2db10f3574b1c265bddd07add29 Mon Sep 17 00:00:00 2001 From: Mingun Date: Sun, 12 Dec 2021 03:03:56 +0500 Subject: [PATCH 1/2] Fix sizeof test for https://github.com/kaitai-io/kaitai_struct_compiler/pull/236 --- formats_err/expr_sizeof_value_dynamic3.ksy | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/formats_err/expr_sizeof_value_dynamic3.ksy b/formats_err/expr_sizeof_value_dynamic3.ksy index 0d0dbfe2d..34312a6db 100644 --- a/formats_err/expr_sizeof_value_dynamic3.ksy +++ b/formats_err/expr_sizeof_value_dynamic3.ksy @@ -1,14 +1,16 @@ -# ? +# expr_sizeof_value_dynamic3.ksy: /instances/body_sizeof/value: +# error: unable to derive sizeof of `Name(identifier(body))`: dynamic sized type +# meta: id: expr_sizeof_value_dynamic3 endian: le seq: - - id: num + - id: num_body type: u2 - id: body type: u1 repeat: expr - repeat-expr: num + repeat-expr: num_body instances: body_sizeof: value: body._sizeof From ef892ffdbe845c34216ebe5cf27bfeab8a35ee82 Mon Sep 17 00:00:00 2001 From: Mingun Date: Sun, 6 Oct 2024 11:04:13 +0500 Subject: [PATCH 2/2] Add case for https://github.com/kaitai-io/kaitai_struct/issues/927 --- formats_err/expr_sizeof_cyclic_dependency.ksy | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 formats_err/expr_sizeof_cyclic_dependency.ksy diff --git a/formats_err/expr_sizeof_cyclic_dependency.ksy b/formats_err/expr_sizeof_cyclic_dependency.ksy new file mode 100644 index 000000000..b10202bb9 --- /dev/null +++ b/formats_err/expr_sizeof_cyclic_dependency.ksy @@ -0,0 +1,10 @@ +# expr_sizeof_cyclic_dependency.ksy: /seq/0/if: +# error: unable to derive sizeof for type `expr_sizeof_cyclic_dependency`: dynamic sized type +# +meta: + id: expr_sizeof_cyclic_dependency + -gh-issue: https://github.com/kaitai-io/kaitai_struct/issues/927 +seq: + - id: value + size: 2 + if: _sizeof == 1