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

Decompiler misbehavior #394

Open
meiMingle opened this issue May 11, 2024 · 4 comments
Open

Decompiler misbehavior #394

meiMingle opened this issue May 11, 2024 · 4 comments
Labels
Priority: Medium Medium priority Subsystem: Writing Anything concerning how expressions are written Type: Bug Something isn't working

Comments

@meiMingle
Copy link

meiMingle commented May 11, 2024

Vineflower version

1.10.1

Describe the bug

In line 74 of the source code, The call to the limit method points to the java.nio.Buffer.In fact, this is no problem in the environment of JDK8 and below. But since JDK9, there is a method ByteBuffer limit(int newLimit); in the java.nio.ByteBuffer, which makes the situation different. If you recompile this decompiled code in an environment higher than jdk9, the limit method here will refer to java.nio.ByteBuffer#limit(int), which is inconsistent with the behavior in the source code.

image

image

Additional information

Steps to reproduce
1.Checkout https://github.com/Col-E/InstrumentationServer
2.Execute mvn compile
3.Compare the source code and class file of this method software.coley.instrument.io.ByteBufferSanitizer#ensureWriteable

Also reported here https://youtrack.jetbrains.com/issue/IDEA-353150/Decompiler-misbehavior

@meiMingle meiMingle added the Type: Bug Something isn't working label May 11, 2024
@zml2008
Copy link
Member

zml2008 commented May 11, 2024

Thanks for the report! In theory we should have handling for this issue, not sure why it's not behaving in this case?

@meiMingle

This comment was marked as off-topic.

@meiMingle
Copy link
Author

In addition, the decompilation GUI tool I use is the dev4 branch of Recaf, which runs on my win10 computer, jdk22 (zulu22.30.13-ca)

@jaskarth jaskarth added Subsystem: Writing Anything concerning how expressions are written Priority: Medium Medium priority labels May 20, 2024
@meiMingle
Copy link
Author

meiMingle commented Jun 4, 2024

JetBrains/intellij-community@3a9e1d2
This commit seems to solve this problem, I verified it using IDEA2024.2EAP3
image

meiMingle added a commit to meiMingle/vineflower that referenced this issue Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Medium Medium priority Subsystem: Writing Anything concerning how expressions are written Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants