[erlang-bugs] More compiler errors

Ulf Norell ulf.norell@REDACTED
Fri Feb 28 14:05:33 CET 2014


I ran some more quickcheck tests and found a few more bugs. These are all
tested on R17-rc1:

-module(bug1).
f() when erlang:'andalso'(true, true) ->
  ok.

-module(bug2).
f(X) when erlang:'and'(bad, X) ->
  ok.

-module(bug3).
f(Rec, Tag) ->
  erlang:is_record(Rec, Tag, 1) orelse error.

-module(bug4).
f(_) ->
  (fun f/1)().

Output:

$ erl
Erlang/OTP 17 [RELEASE CANDIDATE 1] [erts-6.0] [source] [64-bit] [smp:8:8]
[async-threads:10] [hipe] [kernel-poll:false]

Eshell V6.0  (abort with ^G)
1> c(bug1).
Function: f/0
bug1.erl: internal error in v3_codegen;
crash reason:
{case_clause,{'EXIT',{{badmatch,{remote,{atom,erlang},{atom,'andalso'}}},
                      [{v3_codegen,call_cg,7,
                                   [{file,"v3_codegen.erl"},{line,1105}]},
                       {v3_codegen,guard_cg,5,
                                   [{file,"v3_codegen.erl"},{line,1002}]},
                       {v3_codegen,'-guard_cg_list/6-anonymous-0-',4,
                                   [{file,"v3_codegen.erl"},{line,1045}]},
                       {v3_codegen,flatmapfoldl,3,
                                   [{file,"v3_codegen.erl"},{line,2222}]},
                       {v3_codegen,guard_cg_list,6,
                                   [{file,"v3_codegen.erl"},{line,1043}]},
                       {v3_codegen,protected_cg,7,
                                   [{file,"v3_codegen.erl"},{line,1015}]},
                       {v3_codegen,guard_clause_cg,4,
                                   [{file,"v3_codegen.erl"},{line,982}]},
                       {v3_codegen,match_cg,5,
                                   [{file,"v3_codegen.erl"},{line,282}]}]}}}

  in function  compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line
494)
  in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line
290)
  in call from compile:fold_comp/3 (compile.erl, line 308)
  in call from compile:internal_comp/4 (compile.erl, line 292)
  in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line
153)
bug1.erl:2: Warning: function f/0 is unused
error
2> c(bug2).
Function: f/1
bug2.erl: internal error in beam_bool;
crash reason: {case_clause,
    {'EXIT',
        {function_clause,
            [{beam_bool,bopt_cg,
                 [{atom,bad},
                  5,
                  [{0,{x,0}}],
                  [],
                  {st,100000000,
                      {3,
                       {2,
                        [{block,
                             [{set,
                                  [{x,1}],
                                  [{atom,bad},{x,0}],
                                  {bif,'and',{f,5}}}]},
                         {test,is_eq_exact,{f,5},[{x,1},{atom,true}]},
                         {block,[{set,[{x,0}],[{atom,ok}],move}]},
                         return,
                         {label,5},
                         {jump,{f,1}},
                         return],
                        {1,
                         [{line,[{location,"bug2.erl",3}]},
                          {func_info,{atom,bug2},{atom,f},1},
                          {label,2},
                          {block,
                              [{set,
                                   [{x,1}],
                                   [{atom,bad},{x,0}],
                                   {bif,'and',{f,5}}}]},
                          {test,is_eq_exact,{f,5},[{x,1},{atom,true}]},
                          {block,[{set,[{x,0}],[{atom,ok}],move}]},
                          return,
                          {label,5},
                          {jump,{f,1}},
                          return],
                         nil,nil},
                        {5,[{jump,{f,1}},return],nil,nil}}}}],
                 [{file,"beam_bool.erl"},{line,505}]},
             {beam_bool,bopt_cg_and,5,[{file,"beam_bool.erl"},{line,552}]},
             {beam_bool,bopt_block,5,[{file,"beam_bool.erl"},{line,115}]},
             {beam_bool,bopt,3,[{file,"beam_bool.erl"},{line,76}]},
             {beam_bool,function,2,[{file,"beam_bool.erl"},{line,57}]},
             {lists,mapfoldl,3,[{file,"lists.erl"},{line,1339}]},
             {beam_bool,module,2,[{file,"beam_bool.erl"},{line,36}]},
             {compile,'-select_passes/2-anonymous-2-',2,
                 [{file,"compile.erl"},{line,494}]}]}}}

  in function  io_lib_pretty:cind_tag_tuple/7 (io_lib_pretty.erl, line 636)
  in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 725)
  in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 695)
  in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 725)
  in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 695)
  in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 725)
  in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 695)
  in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 725)
bug2.erl:3: Warning: function f/1 is unused
error
3> c(bug3).
Function: f/2
bug3.erl: internal error in v3_codegen;
crash reason:
{case_clause,{'EXIT',{{badmatch,{remote,{atom,erlang},{atom,is_record}}},
                      [{v3_codegen,call_cg,7,
                                   [{file,"v3_codegen.erl"},{line,1105}]},
                       {v3_codegen,guard_cg,5,
                                   [{file,"v3_codegen.erl"},{line,1002}]},
                       {v3_codegen,'-guard_cg_list/6-anonymous-0-',4,
                                   [{file,"v3_codegen.erl"},{line,1045}]},
                       {v3_codegen,flatmapfoldl,3,
                                   [{file,"v3_codegen.erl"},{line,2222}]},
                       {v3_codegen,guard_cg_list,6,
                                   [{file,"v3_codegen.erl"},{line,1043}]},
                       {v3_codegen,protected_cg,7,
                                   [{file,"v3_codegen.erl"},{line,1015}]},
                       {v3_codegen,guard_clause_cg,4,
                                   [{file,"v3_codegen.erl"},{line,982}]},
                       {v3_codegen,match_cg,5,
                                   [{file,"v3_codegen.erl"},{line,282}]}]}}}

  in function  compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line
494)
  in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line
290)
  in call from compile:fold_comp/3 (compile.erl, line 308)
  in call from compile:internal_comp/4 (compile.erl, line 292)
  in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line
153)
bug3.erl:2: Warning: function f/2 is unused
error
4> c(bug4).
Function f/1 refers to undefined label 5
bug4.erl: internal error in beam_dead;
crash reason: {case_clause,{'EXIT',{undefined_label,5}}}

  in function  compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line
494)
  in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line
290)
  in call from compile:fold_comp/3 (compile.erl, line 308)
  in call from compile:internal_comp/4 (compile.erl, line 292)
  in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line
153)
bug4.erl:2: Warning: function f/1 is unused
error

/ Ulf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20140228/9a3af594/attachment.htm>


More information about the erlang-bugs mailing list