Uploaded image for project: 'Erlang/OTP'
  1. Erlang/OTP
  2. ERL-1170

Compiler crash in receive statement

    XMLWordPrintable

    Details

      Description

      -module(test).
      -export([foo/0]).
      
      foo() -> {} = receive _ -> {} = {} end.
      

      Given to the compiler it crashes with:

      ~/Scratch/otp_weird: erlc test.erl
      Function: foo/0
      test.erl: internal error in sys_core_fold;
      crash reason: {case_clause,
          {'EXIT',
              {{case_clause,
                   {[],
                    {c_receive,
                        [5,{file,"test.erl"}],
                        [{c_clause,
                             [5,{file,"test.erl"}],
                             [{c_var,[],3}],
                             {c_literal,[],true},
                             {c_values,[],[]}}],
                        {c_literal,[],infinity},
                        {c_values,[],[]}},
                    {c_literal,[compiler_generated],{}}}},
               [{sys_core_fold,opt_simple_let_2,6,
                    [{file,"sys_core_fold.erl"},{line,2766}]},
                {sys_core_fold,clause_1,5,[{file,"sys_core_fold.erl"},{line,1236}]},
                {sys_core_fold,clauses,5,[{file,"sys_core_fold.erl"},{line,1570}]},
                {sys_core_fold,expr,3,[{file,"sys_core_fold.erl"},{line,391}]},
                {sys_core_fold,expr,3,[{file,"sys_core_fold.erl"},{line,306}]},
                {sys_core_fold,find_fixpoint,3,
                    [{file,"sys_core_fold.erl"},{line,141}]},
                {sys_core_fold,function_1,1,[{file,"sys_core_fold.erl"},{line,127}]},
                {sys_core_fold,'-module/2-lc$^0/1-0-',1,
                    [{file,"sys_core_fold.erl"},{line,112}]}]}}}  in function  compile:'-select_passes/2-anonymous-2-'/3 (compile.erl, line 675)
        in call from compile:'-internal_comp/5-anonymous-1-'/3 (compile.erl, line 399)
        in call from compile:fold_comp/4 (compile.erl, line 426)
        in call from compile:internal_comp/5 (compile.erl, line 410)
        in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 207)
        in call from compile:'-do_compile/2-anonymous-1-'/1 (compile.erl, line 223)
      

      Works with OTP-21.

        Attachments

          Activity

            People

            Assignee:
            bjorn Björn Gustavsson
            Reporter:
            hanssv hanssv
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: