Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): fix primitive-to-primitive conversions #2326

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

pubiqq
Copy link
Contributor

@pubiqq pubiqq commented Oct 28, 2024

The PR fixes incorrect primitive-to-primitive conversions:

  • byte -> char - WIDER (not CONFLICT)
  • short -> char - WIDER (not CONFLICT)
  • char -> byte - WIDER (not CONFLICT)
  • char -> short - WIDER (not CONFLICT)
  • long -> float - NARROW (not WIDER)
  • float -> long - WIDER (not NARROW)
  • numeric -> void - CONFLICT (not NARROW)
  • void -> numeric - CONFLICT (not WIDER)

Fixes #1620, fixes #1621, fixes #1626, indirectly fixes JadxRuntimeException: Unknown type in literalToString: void.

@skylot
Copy link
Owner

skylot commented Oct 28, 2024

@pubiqq please describe what compare got changed/improved, because it is hard to see what was wrong only from changes. Also, please provide decompilation tests or at least samples which are improved after this change.

@skylot
Copy link
Owner

skylot commented Oct 28, 2024

Thanks.
I see, so these issues was in incorrect cast removal because of incorrect type compare for long and float.
Looks like this happen because type inference never compare these types (2 register types not clash with 1 register types), and that was the only usage of that compare for a long time, cast check was added later.

@skylot skylot merged commit 4d8a5d6 into skylot:master Oct 28, 2024
4 checks passed
@pubiqq
Copy link
Contributor Author

pubiqq commented Oct 28, 2024

The issue is not related to long and float only, but anyway, it's fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants