erlang / otp

Erlang/OTP
http://erlang.org
Apache License 2.0
11.15k stars 2.92k forks source link

[erlc] internal consistency check failed #8617

Closed RobinMorisset closed 3 days ago

RobinMorisset commented 5 days ago

Describe the bug

-module(test883181).
-export([f1/0]).

f1() ->
    [ 0 || <<_:0, _V2:(tuple_size({self()}))>> <= <<>>, (self() ! [ 0 ||  _V2])].

crashes erlc with the error message:

test883181:1: function '-f1/0-lc$^0/1-0-'/1+10:
  Internal consistency check failed - please report this bug.
  Instruction: {bs_match,{f,0},{x,0},{commands,[{skip,1}]}}
  Error:       throws_exception:

Affected versions

Additional context This might be another instance of #7342, I'm reporting it because I don't remember seeing this particular error message before (usually there is {bad_type_arg, ...} where there is just throws_exception here).

bjorng commented 4 days ago

Thanks!

This is not an instance of #7342, but an interaction between the CSE optimizations and binary matching optimizations.