Skip to content

fix(r8): Synthesize file name for foreign members and classes without sourceFile annotation#70

Merged
romtsn merged 4 commits intorz/feat/r8-tests-inlinefrom
rz/fix/r8-tests-inline-synthesize-classname
Dec 18, 2025
Merged

fix(r8): Synthesize file name for foreign members and classes without sourceFile annotation#70
romtsn merged 4 commits intorz/feat/r8-tests-inlinefrom
rz/fix/r8-tests-inline-synthesize-classname

Conversation

@romtsn
Copy link
Copy Markdown
Member

@romtsn romtsn commented Dec 17, 2025

From the test cases in #69 it seems r8-retrace always synthesizes filenames from class names, so this PR attempts to do the same for mapper/cache and also updates existing test cases to match the new behavior (the tests in r8-inline.rs should be passing with this change)

@romtsn romtsn requested a review from loewenheim December 17, 2025 17:03
Comment thread src/cache/raw.rs
Comment on lines +318 to 328
let file_name_offset = class_info
.and_then(|ci| ci.source_file)
.map_or(u32::MAX, |s| string_table.insert(s) as u32);
let class = ClassInProgress {
class: Class {
original_name_offset,
obfuscated_name_offset,
file_name_offset,
is_synthesized: is_synthesized as u8,
..Default::default()
},

This comment was marked as outdated.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think anything changed we just started using/supplying file_name_offset

Comment thread src/cache/mod.rs Outdated
Comment thread src/mapper.rs
@romtsn romtsn merged commit 0823cb6 into rz/feat/r8-tests-inline Dec 18, 2025
6 checks passed
@romtsn romtsn deleted the rz/fix/r8-tests-inline-synthesize-classname branch December 18, 2025 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants