Skip to content

bad_typed_register failure in beam_validator #7354

Closed
@bjorng

Description

@bjorng

Describe the bug
Compilation fails:

Internal consistency check failed - please report this bug.
  Instruction: {test,is_eq_exact,
                     {f,4},
                     [{tr,{y,0},{t_integer,any}},{integer,0}]}
  Error:       {bad_typed_register,{t_bitstring,256,true},{t_integer,any}}:

To Reproduce
Compile the following function:

f(_V0) ->
    case
        trunc(
            try
                trunc(<<>> = _V0)
            catch
                _ ->
                    0.0
            end
        )
    of
        _V0 -> ok;
        _ -> 42
    end.

Expected behavior
Successful compilation.

Affected versions
OTP 25, OTP 26, master

Additional context
Originally posted in #6599 and #7342. This bug is related to #7147.

Metadata

Metadata

Assignees

Labels

bugIssue is reported as a bugteam:VMAssigned to OTP team VM

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions