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

Compiler crash on badly matching statement

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: OTP-22.0, OTP-22.1, OTP-22.2
    • Fix Version/s: 22.2.7
    • Component/s: compiler
    • Labels:
      None

      Description

      -module(test).
      -export([foo/1]).
      
      foo(X) ->
        true = 0 / X.
      

      OK, admittedly not the most important piece of code ever written, but still when given to the compiler it crashes:

      ~/Scratch/otp_weird: erlc test.erl
      Function: foo/1
      test.erl: internal error in beam_except;
      crash reason: {case_clause,
          {'EXIT',
              {badarith,
                  [{erlang,'-',[{alloc,[{words,3},{floats,1}]},3],[]},
                   {beam_except,fix_block_1,2,[{file,"beam_except.erl"},{line,135}]},
                   {beam_except,fix_block_1,2,[{file,"beam_except.erl"},{line,143}]},
                   {beam_except,translate_exception,4,
                       [{file,"beam_except.erl"},{line,132}]},
                   {beam_except,dig_out,1,[{file,"beam_except.erl"},{line,104}]},
                   {beam_except,translate_1,5,[{file,"beam_except.erl"},{line,78}]},
                   {beam_except,function,1,[{file,"beam_except.erl"},{line,45}]},
                   {beam_except,'-module/2-lc$^0/1-0-',1,
                       [{file,"beam_except.erl"},{line,40}]}]}}}  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)
      

      Working well on OTP-21, failing on all tested OTP-22's, including OTP-22.2.6

        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: