Skip to content

compiler: Avoid crash in private-append optimization #6862

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

Merged
merged 1 commit into from
Feb 17, 2023

Conversation

frej
Copy link
Contributor

@frej frej commented Feb 15, 2023

Avoid a crash in the private-append optimization due to attempting to rewrite a literal which isn't a bitstring.

As value tracking is done without type information, it can happen that when following def chains, we encounter literals which are not bitstrings. We should never schedule a literal which isn't a bitstring for rewriting when the complete literal is what we are tracking, i.e. when the element is self.

Closes #6847

Avoid a crash in the private-append optimization due to attempting to
rewrite a literal which isn't a bitstring.

As value tracking is done without type information, it can happen that
when following def chains, we encounter literals which are not
bitstrings. We should never schedule a literal which isn't a bitstring
for rewriting when the complete literal is what we are tracking,
i.e. when the element is `self`.

Closes erlang#6847
@github-actions
Copy link
Contributor

github-actions bot commented Feb 15, 2023

CT Test Results

       2 files     295 suites   12m 27s ⏱️
   761 tests    759 ✔️ 2 💤 0
4 708 runs  4 706 ✔️ 2 💤 0

Results for commit 1752215.

♻️ This comment has been updated with latest results.

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 self-assigned this Feb 15, 2023
@bjorng bjorng added team:VM Assigned to OTP team VM fix testing currently being tested, tag is used by OTP internal CI labels Feb 15, 2023
@bjorng
Copy link
Contributor

bjorng commented Feb 15, 2023

Thanks! Added to our daily builds.

@bjorng bjorng merged commit 73d93d8 into erlang:master Feb 17, 2023
@frej frej deleted the frej/private-append-crash-gh6847 branch February 17, 2023 11:49
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.

Compiler crash in pass beam_ssa_opt, sub pass ssa_opt_private_append
2 participants