Closed
Description
Describe the bug
Running erlc on the following code:
f(<<X/utf8>>) ->
case 9223372036854775807 - abs(X) of
Y when X < Y ->
ok;
9223372036854775807 ->
ok;
-2147483648 ->
ok
end.
results in the following error:
Function: f/1
/home/rmorisset/minimized/erlc_opts_5.erl: internal error in pass beam_validator_strong:
exception error: no match of right hand side value false
in function beam_validator:unpack_typed_arg/2 (beam_validator.erl, line 2833)
in call from beam_validator:vi/2 (beam_validator.erl, line 513)
in call from beam_validator:validate_instrs/4 (beam_validator.erl, line 333)
in call from beam_validator:validate_1/5 (beam_validator.erl, line 276)
in call from beam_validator:validate_0/4 (beam_validator.erl, line 114)
in call from beam_validator:validate/2 (beam_validator.erl, line 56)
in call from compile:beam_validator_1/3 (compile.erl, line 1682)
in call from compile:fold_comp/4 (compile.erl, line 410)
Affected versions
- master
- master + beam_ssa_private_append: Fix crash on oddly structured code #7143 + beam_bounds: Make 'bnot' converge faster #7157 + Fix two type-related bugs #7163
Additional context
Despite having a near-identical stack trace to #7147, I believe that this is a different bug as it is not fixed by #7163.
With the commit 039c5de, we get the following slightly more informative error message instead:
erlc_opts_5:1: function f/1+18:
Internal consistency check failed - please report this bug.
Instruction: {test,is_eq_exact,
{f,12},
[{tr,{x,0},
{t_integer,{9223372036853661696,
9223372036854775807}}},
{integer,-2147483648}]}
Error: {bad_typed_register,
{t_integer,{'-inf',1114111}},
{t_integer,{9223372036853661696,9223372036854775807}}}: