Skip to content

Commit 5d13924

Browse files
committed
docs(derive_tasm_object): Add description to code-generator for encoding lengths
1 parent e2ac030 commit 5d13924

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

derive_tasm_object/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ fn impl_derive_tasm_object_macro(ast: DeriveInput) -> TokenStream {
190190
let push_neg_1 = crate::triton_vm::instruction::LabelledInstruction::Instruction(crate::triton_vm::instruction::AnInstruction::Push(crate::triton_vm::prelude::BFieldElement::new(crate::triton_vm::prelude::BFieldElement::P-1)));
191191
let mul = crate::triton_vm::instruction::LabelledInstruction::Instruction(crate::triton_vm::instruction::AnInstruction::Mul);
192192

193+
// Get `*field` and `size` for last field of encoding, which is the 1st in the definition.
194+
// Then add them to a pointer one past the end of the object. Then subtract `*object`
195+
// of the object to get final size.
193196
let extract_encoding_size = [
194197
// _ *object *field size
195198
add.clone(),

0 commit comments

Comments
 (0)