classfile,passes,jar: model PermittedSubclasses, normalize interface flags, name class in write errors

This commit is contained in:
Loki 2026-10-10 14:22:03 +02:00
parent e9d5e44b9e
commit 9a33cef9b1
Signed by: boba
GPG key ID: 253067914055423B
11 changed files with 299 additions and 85 deletions

View file

@ -46,7 +46,13 @@ pub fn save(program: &Program) -> Result<Vec<Entry>, JarError> {
for class in &program.classes {
let name = format!("{}.class", class.this_class);
entries.push(Entry::new(name, format::write(class)?));
let bytes = format::write(class).map_err(|error| {
JarError::Classfile(noxis_classfile::ClassfileError::Write(format!(
"{}: {error}",
class.this_class
)))
})?;
entries.push(Entry::new(name, bytes));
}
for resource in &program.resources {
entries.push(Entry::new(resource.path.clone(), resource.data.clone()));