[erlang-bugs] Internal error in core_fold_module when repeating boolean case branch

Anthony Ramine n.oxyde@REDACTED
Sat Mar 8 02:36:18 CET 2014


https://github.com/erlang/otp/pull/280

-- 
Anthony Ramine

Le 3 mars 2014 à 08:44, Ulf Norell <ulf.norell@REDACTED> a écrit :

> -module(bug).
> f(X) ->
>   case X == 0 of
>     false -> no;
>     false -> no;
>     true  -> yes
>   end.
> 
> $ erl
> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
> 
> Eshell V6.0  (abort with ^G)
> 
> 1> c(bug).
> Function: f/1
> bug.erl: internal error in core_fold_module;
> crash reason: function_clause
> 
>   in function  sys_core_fold:opt_bool_case_guard/2
>      called as sys_core_fold:opt_bool_case_guard({c_call,[3,{file,"bug.erl"}],
>          {c_literal,[3,{file,"bug.erl"}],erlang},
>          {c_literal,[3,{file,"bug.erl"}],'=='},
>          [{c_var,[3,{file,"bug.erl"}],'X'},
>           {c_literal,[3,{file,"bug.erl"}],0}]},
>  [{c_clause,[4,{file,"bug.erl"}],
>             [{c_literal,[4,{file,"bug.erl"}],false}],
>             {c_literal,[],true},
>             {c_literal,[4,{file,"bug.erl"}],no}},
>   {c_clause,[5,{file,"bug.erl"}],
>             [{c_literal,[5,{file,"bug.erl"}],false}],
>             {c_literal,[],true},
>             {c_literal,[5,{file,"bug.erl"}],no}},
>   {c_clause,[6,{file,"bug.erl"}],
>             [{c_literal,[6,{file,"bug.erl"}],true}],
>             {c_literal,[],true},
>             {c_literal,[6,{file,"bug.erl"}],yes}}])
>   in call from sys_core_fold:opt_bool_case_guard/1 (sys_core_fold.erl, line 1933)
>   in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 347)
>   in call from sys_core_fold:clause/4 (sys_core_fold.erl, line 1481)
>   in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1699)
>   in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 352)
>   in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 279)
>   in call from sys_core_fold:function_1/1 (sys_core_fold.erl, line 117)
> bug.erl:2: Warning: function f/1 is unused
> error
> 
> / Ulf
> 
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://erlang.org/mailman/listinfo/erlang-bugs




More information about the erlang-bugs mailing list