Skip to content

fix: Change HashMap to BTreeMap for deterministic function ordering#6

Merged
marirs merged 1 commit intomarirs:masterfrom
jorgeaduran:master
Mar 21, 2025
Merged

fix: Change HashMap to BTreeMap for deterministic function ordering#6
marirs merged 1 commit intomarirs:masterfrom
jorgeaduran:master

Conversation

@jorgeaduran
Copy link
Contributor

  • This commit changes the data structure used for storing function candidates from HashMap to BTreeMap. Since BTreeMap maintains keys in sorted order, this ensures consistent function ordering across runs, fixing the issue where different numbers of functions were being returned on each execution.
  • Results were unstable in 1e2791877da02d49998dea79515a89ca due to the non-deterministic
    nature of HashMap iteration ordering.
  • Also fixes a critical bug in get_code_areas() where executable sections that were already aligned to 0x1000 bytes were being excluded from the results.

- This commit changes the data structure used for storing function candidates
from HashMap to BTreeMap. Since BTreeMap maintains keys in sorted order,
this ensures consistent function ordering across runs, fixing the issue where
different numbers of functions were being returned on each execution.

- Also fixes a critical bug in get_code_areas() where executable sections that
were already aligned to 0x1000 bytes were being excluded from the results.
@marirs
Copy link
Owner

marirs commented Mar 21, 2025

Thank you very much

@marirs marirs merged commit a90d1e0 into marirs:master Mar 21, 2025
4 checks passed
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