[erlang-bugs] Internal error in beam_jump when using guards after a map pattern

Ulf Norell ulf.norell@REDACTED
Tue Mar 4 09:51:17 CET 2014


-module(bug).
f(#{a := 0}) when #{} == #{}; true -> ok.

Same error for this:

-module(also_bug).
f(#{a := 0}) when true; map_size(0) -> ok.

There seems to be a general problem with complex guards under map patterns.
I
ended up disabling all guards after a match on a map in the program
generator.

$ 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 beam_bool;
crash reason: {case_clause,{'EXIT',{{case_clause,{get_map_elements,{f,5}}},
                      [{beam_jump,is_label_used_in_2,2,
                                  [{file,"beam_jump.erl"},{line,446}]},
                       {lists,any,2,[{file,"lists.erl"},{line,1223}]},
                       {beam_jump,is_label_used_in_1,3,
                                  [{file,"beam_jump.erl"},{line,438}]},
                       {beam_bool,split_block,5,
                                  [{file,"beam_bool.erl"},{line,278}]},

 {beam_bool,bopt,3,[{file,"beam_bool.erl"},{line,64}]},
                       {beam_bool,function,2,
                                  [{file,"beam_bool.erl"},{line,57}]},
                       {lists,mapfoldl,3,[{file,"lists.erl"},{line,1352}]},
                       {beam_bool,module,2,
                                  [{file,"beam_bool.erl"},{line,36}]}]}}}

  in function  compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line
493)
  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)
bug.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/20140304/741ca8f5/attachment.htm>


More information about the erlang-bugs mailing list