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 two type-related bugs #7163

Conversation

bjorng
Copy link
Contributor

@bjorng bjorng commented Apr 25, 2023

Issue #7147 uncovered two bugs in the compiler.

The first one is in the swapping of operands for commutative operands, which the compiler does to simplify for the JIT. When the operands were swapped, types for the operands in the annotation were not updated.

The second one is in beam_validator, which assumed that if the binary construction <<F/float>> succeeded, then F must be a float. That is not correct, because F could also be an integer.

Closes #7147

Issue erlang#7147 uncovered two bugs in the compiler.

The first one is in the swapping of operands for commutative operands,
which the compiler does to simplify for the JIT. When the operands
were swapped, types for the operands in the annotation were not
updated.

The second one is in `beam_validator`, which assumed that if the
binary construction `<<F/float>>` succeeded, then `F` must be a
float. That is not correct, because `F` could also be an integer.

Closes erlang#7147
@bjorng bjorng added team:VM Assigned to OTP team VM fix labels Apr 25, 2023
@bjorng bjorng requested a review from jhogberg April 25, 2023 07:34
@bjorng bjorng self-assigned this Apr 25, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 25, 2023

CT Test Results

No tests were run for this PR. This is either because the build failed, or the PR is based on a branch without GH actions tests configured.

Results for commit fe60441

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@bjorng bjorng added the testing currently being tested, tag is used by OTP internal CI label Apr 25, 2023
@bjorng bjorng force-pushed the bjorn/compiler/beam_validator/26/GH-7147/OTP-18565 branch from fe60441 to b178b93 Compare April 26, 2023 10:40
@bjorng bjorng merged commit 3b8de43 into erlang:master Apr 26, 2023
@bjorng bjorng deleted the bjorn/compiler/beam_validator/26/GH-7147/OTP-18565 branch April 26, 2023 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[erlc] internal error in pass beam_validator_strong
2 participants