Skip to content

Compiler: Add assertion for violation of argument type invariant - #11746

Merged
bjorng merged 3 commits into
erlang:masterfrom
bjorng:bjorn/compiler/assertions
Oct 8, 2026
Merged

bjorng merged 3 commits into
erlang:masterfrom
bjorng:bjorn/compiler/assertions

Conversation

@bjorng

@bjorng bjorng commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Abort the compilation if an expected invariant for argument types is violated.

@bjorng bjorng self-assigned this Oct 1, 2026
@bjorng bjorng added team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI labels Oct 1, 2026
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

CT Test Results

    2 files    332 suites   7m 52s ⏱️
  897 tests   893 ✅ 4 💤 0 ❌
5 717 runs  5 713 ✅ 4 💤 0 ❌

Results for commit ca20bf8.

♻️ 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

lucioleKi and others added 2 commits October 1, 2026 15:00
Converting the following expression:

    case V of
        true -> true;
        false -> true
    end

to:

    is_boolean(V)

could result in the loss of type information, causing types to be
widened during the optimization pass of `beam_ssa_type`.

Co-authored-by: Isabell Huang <isabell@erlang.org>
@bjorng
bjorng force-pushed the bjorn/compiler/assertions branch from 46889aa to 5c63dfd Compare October 1, 2026 13:04
After the signature pass of beam_ssa_type, while doing type-based
optimizations, an invariant to be maintained is that argument types
are not widened. Abort the compilation if this invariant is violated.
@bjorng
bjorng force-pushed the bjorn/compiler/assertions branch 2 times, most recently from b62ec58 to ca20bf8 Compare October 5, 2026 12:05
@bjorng
bjorng requested review from jhogberg and lucioleKi October 5, 2026 12:05
@bjorng
bjorng merged commit c3d021c into erlang:master Oct 8, 2026
31 checks passed
@bjorng
bjorng deleted the bjorn/compiler/assertions branch October 8, 2026 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2 participants