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

internal error in beam_ssa_codegen

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 22.3.4.1
    • Fix Version/s: OTP 22.3.4.3
    • Component/s: compiler
    • Labels:
      None

      Description

      The following code fails to compile:

      -module(foo).
      
      -define(Inner(Val), <<"-", Val/binary>>).
      -define(Outer(Val),
              case Val of
                _ when is_list(Val) ->
                  Val;
                _ ->
                  [ Val ]
              end
             ).
      
      crashes(Val) ->
        ?Outer(?Inner(Val)).
      
      %% works(Val) ->
      %%   Inner = ?Inner(Val),
      %%   ?Outer(Inner).
      

      The following error is returned:

      Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yamlsrc/foo.erl:none: internal error in beam_ssa_codegen;
      crash reason: {case_clause,
          {'EXIT',
              {function_clause,
                  [{beam_ssa_codegen,cg_instr,
                       [bs_add,[{x,1},{integer,1},{integer,1}],{x,2}],
                       []},
                   {beam_ssa_codegen,cg_block,3,
                       [{file,"beam_ssa_codegen.erl"},{line,1248}]},
                   {beam_ssa_codegen,cg_linear,2,
                       [{file,"beam_ssa_codegen.erl"},{line,961}]},
                   {beam_ssa_codegen,cg_linear,2,
                       [{file,"beam_ssa_codegen.erl"},{line,962}]},
                   {beam_ssa_codegen,function,3,
                       [{file,"beam_ssa_codegen.erl"},{line,127}]},
                   {lists,mapfoldl,3,[{file,"lists.erl"},{line,1354}]},
                   {beam_ssa_codegen,module,2,
                       [{file,"beam_ssa_codegen.erl"},{line,47}]},
                   {compile,'-select_passes/2-anonymous-2-',3,
                       [{file,"compile.erl"},{line,675}]}]}}}
      
        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)
      
      src/foo.erl:14: Warning: function crashes/1 is unused
      

      This has been simplified from a production example which used to compile under Erlang 21.

        Attachments

          Activity

            People

            Assignee:
            john John Högberg
            Reporter:
            philipstears philipstears
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: