[erlang-bugs] Internal error in v3_codegen when using [] as map key

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


I started generating map expressions in the program generator. First of
many:

-module(bug).
f() -> #{[] => 0, a => 1}.

$ 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/0
bug.erl: internal error in v3_codegen;
crash reason:
{case_clause,{'EXIT',{{case_clause,{{{atom,a},{integer,1}},{nil,{integer,0}}}},

[{v3_codegen,'-map_pair_strip_and_termsort/1-anonymous-1-',
                                   2,
                                   [{file,"v3_codegen.erl"},{line,1554}]},
                       {lists,sort,2,[{file,"lists.erl"},{line,967}]},
                       {v3_codegen,set_cg,6,
                                   [{file,"v3_codegen.erl"},{line,1522}]},
                       {v3_codegen,'-cg_list/5-anonymous-0-',3,
                                   [{file,"v3_codegen.erl"},{line,190}]},
                       {v3_codegen,flatmapfoldl,3,
                                   [{file,"v3_codegen.erl"},{line,2161}]},
                       {v3_codegen,cg_list,5,
                                   [{file,"v3_codegen.erl"},{line,189}]},
                       {v3_codegen,cg_block,5,
                                   [{file,"v3_codegen.erl"},{line,437}]},
                       {v3_codegen,block_cg,4,
                                   [{file,"v3_codegen.erl"},{line,422}]}]}}}

  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/0 is unused
error

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


More information about the erlang-bugs mailing list