<div dir="ltr">I ran some more quickcheck tests and found a few more bugs. These are all tested on R17-rc1:<div><br></div><div><div>-module(bug1).</div><div>f() when erlang:'andalso'(true, true) -></div><div> ok.</div>
<div><br></div><div>-module(bug2).</div><div>f(X) when erlang:'and'(bad, X) -></div><div> ok.</div><div><br></div><div>-module(bug3).</div><div>f(Rec, Tag) -></div><div> erlang:is_record(Rec, Tag, 1) orelse error.</div>
<div><br></div><div>-module(bug4).</div><div>f(_) -></div><div> (fun f/1)().</div><div><br></div><div>Output:</div><div><br></div><div>$ erl</div><div>Erlang/OTP 17 [RELEASE CANDIDATE 1] [erts-6.0] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]</div>
<div><br></div><div>Eshell V6.0 (abort with ^G)</div><div>1> c(bug1).</div><div>Function: f/0</div><div>bug1.erl: internal error in v3_codegen;</div><div>crash reason: {case_clause,{'EXIT',{{badmatch,{remote,{atom,erlang},{atom,'andalso'}}},</div>
<div> [{v3_codegen,call_cg,7,</div><div> [{file,"v3_codegen.erl"},{line,1105}]},</div><div> {v3_codegen,guard_cg,5,</div><div> [{file,"v3_codegen.erl"},{line,1002}]},</div>
<div> {v3_codegen,'-guard_cg_list/6-anonymous-0-',4,</div><div> [{file,"v3_codegen.erl"},{line,1045}]},</div><div> {v3_codegen,flatmapfoldl,3,</div>
<div> [{file,"v3_codegen.erl"},{line,2222}]},</div><div> {v3_codegen,guard_cg_list,6,</div><div> [{file,"v3_codegen.erl"},{line,1043}]},</div>
<div> {v3_codegen,protected_cg,7,</div><div> [{file,"v3_codegen.erl"},{line,1015}]},</div><div> {v3_codegen,guard_clause_cg,4,</div>
<div>
[{file,"v3_codegen.erl"},{line,982}]},</div><div> {v3_codegen,match_cg,5,</div><div> [{file,"v3_codegen.erl"},{line,282}]}]}}}</div>
<div><br></div><div> in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 494)</div><div> in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290)</div><div> in call from compile:fold_comp/3 (compile.erl, line 308)</div>
<div> in call from compile:internal_comp/4 (compile.erl, line 292)</div><div> in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 153)</div><div>bug1.erl:2: Warning: function f/0 is unused</div>
<div>error</div><div>2> c(bug2).</div><div>Function: f/1</div><div>bug2.erl: internal error in beam_bool;</div><div>crash reason: {case_clause,</div><div> {'EXIT',</div><div> {function_clause,</div><div>
[{beam_bool,bopt_cg,</div><div> [{atom,bad},</div><div> 5,</div><div> [{0,{x,0}}],</div><div> [],</div><div> {st,100000000,</div>
<div> {3,</div><div> {2,</div><div> [{block,</div><div> [{set,</div><div> [{x,1}],</div><div>
[{atom,bad},{x,0}],</div>
<div> {bif,'and',{f,5}}}]},</div><div> {test,is_eq_exact,{f,5},[{x,1},{atom,true}]},</div><div> {block,[{set,[{x,0}],[{atom,ok}],move}]},</div>
<div> return,</div><div> {label,5},</div><div> {jump,{f,1}},</div><div> return],</div><div> {1,</div>
<div>
[{line,[{location,"bug2.erl",3}]},</div><div> {func_info,{atom,bug2},{atom,f},1},</div><div> {label,2},</div><div> {block,</div>
<div> [{set,</div><div> [{x,1}],</div><div> [{atom,bad},{x,0}],</div><div> {bif,'and',{f,5}}}]},</div>
<div> {test,is_eq_exact,{f,5},[{x,1},{atom,true}]},</div><div> {block,[{set,[{x,0}],[{atom,ok}],move}]},</div><div> return,</div><div> {label,5},</div>
<div> {jump,{f,1}},</div><div> return],</div><div> nil,nil},</div><div> {5,[{jump,{f,1}},return],nil,nil}}}}],</div><div> [{file,"beam_bool.erl"},{line,505}]},</div>
<div> {beam_bool,bopt_cg_and,5,[{file,"beam_bool.erl"},{line,552}]},</div><div> {beam_bool,bopt_block,5,[{file,"beam_bool.erl"},{line,115}]},</div><div> {beam_bool,bopt,3,[{file,"beam_bool.erl"},{line,76}]},</div>
<div> {beam_bool,function,2,[{file,"beam_bool.erl"},{line,57}]},</div><div> {lists,mapfoldl,3,[{file,"lists.erl"},{line,1339}]},</div><div> {beam_bool,module,2,[{file,"beam_bool.erl"},{line,36}]},</div>
<div> {compile,'-select_passes/2-anonymous-2-',2,</div><div> [{file,"compile.erl"},{line,494}]}]}}}</div><div><br></div><div> in function io_lib_pretty:cind_tag_tuple/7 (io_lib_pretty.erl, line 636)</div>
<div> in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 725)</div><div> in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 695)</div><div> in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 725)</div>
<div> in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 695)</div><div> in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 725)</div><div> in call from io_lib_pretty:cind_list/7 (io_lib_pretty.erl, line 695)</div>
<div> in call from io_lib_pretty:cind_element/7 (io_lib_pretty.erl, line 725)</div><div>bug2.erl:3: Warning: function f/1 is unused</div><div>error</div><div>3> c(bug3).</div><div>Function: f/2</div><div>bug3.erl: internal error in v3_codegen;</div>
<div>crash reason: {case_clause,{'EXIT',{{badmatch,{remote,{atom,erlang},{atom,is_record}}},</div><div> [{v3_codegen,call_cg,7,</div><div> [{file,"v3_codegen.erl"},{line,1105}]},</div>
<div> {v3_codegen,guard_cg,5,</div><div> [{file,"v3_codegen.erl"},{line,1002}]},</div><div> {v3_codegen,'-guard_cg_list/6-anonymous-0-',4,</div>
<div> [{file,"v3_codegen.erl"},{line,1045}]},</div><div> {v3_codegen,flatmapfoldl,3,</div><div> [{file,"v3_codegen.erl"},{line,2222}]},</div>
<div> {v3_codegen,guard_cg_list,6,</div><div> [{file,"v3_codegen.erl"},{line,1043}]},</div><div> {v3_codegen,protected_cg,7,</div><div>
[{file,"v3_codegen.erl"},{line,1015}]},</div><div> {v3_codegen,guard_clause_cg,4,</div><div> [{file,"v3_codegen.erl"},{line,982}]},</div>
<div> {v3_codegen,match_cg,5,</div><div> [{file,"v3_codegen.erl"},{line,282}]}]}}}</div><div><br></div><div> in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 494)</div>
<div> in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290)</div><div> in call from compile:fold_comp/3 (compile.erl, line 308)</div><div> in call from compile:internal_comp/4 (compile.erl, line 292)</div>
<div> in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 153)</div><div>bug3.erl:2: Warning: function f/2 is unused</div><div>error</div><div>4> c(bug4).</div><div>Function f/1 refers to undefined label 5</div>
<div>bug4.erl: internal error in beam_dead;</div><div>crash reason: {case_clause,{'EXIT',{undefined_label,5}}}</div><div><br></div><div> in function compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 494)</div>
<div> in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290)</div><div> in call from compile:fold_comp/3 (compile.erl, line 308)</div><div> in call from compile:internal_comp/4 (compile.erl, line 292)</div>
<div> in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 153)</div><div>bug4.erl:2: Warning: function f/1 is unused</div><div>error</div></div><div><br></div><div>/ Ulf</div><div><br></div></div>