Skip to content

Conversation

@emesare
Copy link
Member

@emesare emesare commented Dec 7, 2025

This is a draft PR just for visibility, some commits may be dropped, others reworked.

This branch addresses some miscellaneous bugs, as well as code smells such as duplicate APIs and large unstructured modules. The intention with this is to keep breaking changes of well used APIs to a minimum, although APIs which are likely unused by external users (e.g. no known consumer other than internal use like tests or bundled plugins).

APIs inside the architecture module were re-exported after they were moved so this is more or less just a DX change, for those reading the crates documentation or maintaining the architecture module.

@emesare emesare added the Component: Rust API Issue needs changes to the Rust API label Dec 7, 2025
@emesare emesare force-pushed the test_rust_misc_fixes_0 branch from 644791c to 04c8df1 Compare December 9, 2025 00:21
@emesare emesare force-pushed the test_rust_misc_fixes_0 branch from 37b97cf to bf012e1 Compare December 9, 2025 01:43
@emesare emesare self-assigned this Dec 9, 2025
@emesare emesare added this to the Jotunheim milestone Dec 9, 2025
@emesare emesare force-pushed the test_rust_misc_fixes_0 branch from 20e177b to 23b4b21 Compare December 9, 2025 20:51
@emesare emesare force-pushed the test_rust_misc_fixes_0 branch from 23b4b21 to b52660f Compare December 9, 2025 21:51
@emesare emesare force-pushed the test_rust_misc_fixes_0 branch from f1eb4d4 to 5eb4d02 Compare December 9, 2025 22:10
@emesare emesare force-pushed the test_rust_misc_fixes_0 branch from 5eb4d02 to 0a8be8c Compare December 9, 2025 22:13
@emesare emesare force-pushed the test_rust_misc_fixes_0 branch from 0a8be8c to 4cffc75 Compare December 9, 2025 22:26
@emesare
Copy link
Member Author

emesare commented Dec 9, 2025

Marking ready for review, most contentious commits are as follows:

Original PR description still applies for the purpose

@emesare emesare marked this pull request as ready for review December 9, 2025 22:28
@emesare emesare force-pushed the test_rust_misc_fixes_0 branch from 4cffc75 to edc9120 Compare December 10, 2025 01:05
Forgot to call `BNFreeArchitectureAndAddressList`, also use `Location` instead of `ArchAndAddr`.
Use `Location` instead, `arch` can be a nullptr
To keep backwards compatibility for commonly referenced code we re-export them within the architecture module.

Also does some light refactoring of some newly added APIs to keep them more consistent with other parts of the codebase.
There was a TODO there to document that it is optional, we should just wrap it in `Option` instead.
Still need to add a custom architecture for unit tests like in python
- `analysis_info` was causing a double free with function refs, also did not need to be wrapped in a Result
These have been deprecated since last stable, so they will be removed now.

I do believe that there might be some external users of this api so we should alert them.
Prevents type confusions considering there are at times, three different id types being referred to in the type archive API
@emesare
Copy link
Member Author

emesare commented Dec 10, 2025

Due to the changes made in the BasicBlockAnalysisContext I used the Hexagon architecture to test, output looks identical.

image image

@emesare emesare merged commit 8383957 into dev Dec 10, 2025
9 of 10 checks passed
@xNala
Copy link

xNala commented Dec 11, 2025

HUGE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Rust API Issue needs changes to the Rust API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants