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

Wrong bytecode generated for long members #13

Closed
drewhamilton opened this issue May 4, 2020 · 0 comments · Fixed by #14
Closed

Wrong bytecode generated for long members #13

drewhamilton opened this issue May 4, 2020 · 0 comments · Fixed by #14

Comments

@drewhamilton
Copy link
Owner

Already fixed #8 for floats and doubles, I must have missed longs.

drewhamilton added a commit that referenced this issue May 4, 2020
Fix compilation with long members
drewhamilton added a commit that referenced this issue Sep 6, 2023
It is backed by an Int whose hashCode is the identity function.

Before:

    public int hashCode();
      Code:
         0: aload_0
         1: getfield      #13                 // Field uint:I
         4: invokestatic  #35                 // Method kotlin/UInt."hashCode-impl":(I)I
         7: istore_1
         8: iload_1
         9: bipush        31
        11: imul
        12: aload_0
        13: getfield      #17                 // Field long:J
        16: invokestatic  #40                 // Method java/lang/Long.hashCode:(J)I
        19: iadd
        20: istore_1
        21: iload_1
        22: ireturn

After:

    public int hashCode();
      Code:
         0: aload_0
         1: getfield      #13                 // Field uint:I
         4: istore_1
         5: iload_1
         6: bipush        31
         8: imul
         9: aload_0
        10: getfield      #17                 // Field long:J
        13: invokestatic  #34                 // Method java/lang/Long.hashCode:(J)I
        16: iadd
        17: istore_1
        18: iload_1
        19: ireturn

---------

Co-authored-by: Drew Hamilton <github@drewhamilton.dev>
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 a pull request may close this issue.

1 participant