Packages versions
miden-assembly: 0.20.2
miden-mast-package: 0.20.2
Bug description
Procedure attributes (e.g., @note_script) are correctly parsed and stored during library compilation, but they are lost after serialization/deserialization using Library::write_to_file() and Library::read_from_bytes().
This issue was discovered while implementing miden-base#2339, which requires finding procedures with @note_script attribute in serialized libraries.
How can this be reproduced?
- Create a MASM file with a procedure annotation:
@note_script
pub proc main
push.1 drop
end
- Compile to library and check attributes:
let lib = assembler.assemble_library_from_dir(&dir, namespace)?;
for export in lib.exports() {
if let Some(proc) = export.as_procedure() {
println!("BEFORE: {:?}", proc.attributes);
// Output: {"note_script": "None"}
}
}
- Serialize and deserialize:
lib.write_to_file(&path)?;
let lib2 = Library::read_from_bytes(&std::fs::read(&path)?)?;
for export in lib2.exports() {
if let Some(proc) = export.as_procedure() {
println!("AFTER: {:?}", proc.attributes);
// Output: {} (empty)
}
}
Expected: Attributes preserved
Actual: Attributes empty
Relevant log output
Packages versions
miden-assembly: 0.20.2
miden-mast-package: 0.20.2
Bug description
Procedure attributes (e.g.,
@note_script) are correctly parsed and stored during library compilation, but they are lost after serialization/deserialization usingLibrary::write_to_file()andLibrary::read_from_bytes().This issue was discovered while implementing miden-base#2339, which requires finding procedures with
@note_scriptattribute in serialized libraries.How can this be reproduced?
Expected: Attributes preserved
Actual: Attributes empty
Relevant log output