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

[eval] Fix haxe.Int64 to native Int64 conversion #10800

Merged
merged 1 commit into from
Sep 18, 2022

Conversation

Aurel300
Copy link
Member

The problem occurs when low is >= 0x80000000, because Int32.to_int64 sign-extends the low number. The high 32 bits are then all set, so after GInt64.logor the high value is completely lost.

high (int32):   cafecafe
low (int32):    80000001
high (int64):   cafecafe00000000
low (int64):    ffffffff80000001
result:         ffffffff80000001

This fix bitmasks the sign-extended low value to only keep the low 32 bits again.

@Aurel300 Aurel300 requested a review from Simn September 18, 2022 12:45
@Simn Simn merged commit 555cbff into HaxeFoundation:development Sep 18, 2022
@Aurel300 Aurel300 deleted the fix/eval-i64 branch September 18, 2022 19:37
@skial skial mentioned this pull request Sep 21, 2022
1 task
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