[erlang-bugs] Compiler crash with 'inline_list_funcs' and "fun Fun/Arity" notation

Masatake Daimon daimon@REDACTED
Fri May 17 10:55:48 CEST 2013


Hello,

Compiling the following module makes the compiler crash. I'm using
R16B.

===== test.erl =====
-module(test).
-compile(inline).
-compile(inline_list_funcs).
-export([foo/0]).

foo() ->
     lists:map(fun bar/1, [1]).

bar(X) -> X.

===== the crash ====
% erlc test.erl
test: function '-foo/0-lists^map/1-0-'/1+15:
   Internal consistency check failed - please report this bug.
   Instruction: {move,{x,0},{yy,0}}
   Error:       {invalid_store,{yy,0},term}:


Note that the problem disappears with any of these changes:

* Commenting out "-compile(inline)."
* Commenting out "-compile(inline_list_funcs)."
* Changing the definition of foo/0 to:
       foo() ->
           lists:map(fun bar/1, []).   % [] instead of [1]
* Changing the definition of foo/0 to:
       foo() ->
           lists:map(fun (A) -> bar(A) end, [1]).

Regards,
-- 
大門 正岳 <daimon@REDACTED>



More information about the erlang-bugs mailing list