<div dir="ltr">Looks good. Will be graduated after few days of<div>testing in our daily build.s</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 24, 2013 at 9:10 PM, Anthony Ramine <span dir="ltr"><<a href="mailto:n.oxyde@gmail.com" target="_blank">n.oxyde@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
If an Erlang module is compiled to BEAM assembly and the result contains a bs_put_string instruction, the output can't be compiled to binary anymore and the compiler crashes with the following error:<br>
<br>
$ erlc prs.S<br>
Function: compress/1<br>
prs.S:none: internal error in beam_block;<br>
crash reason: {{case_clause,<br>
                   {'EXIT',<br>
                       {function_clause,<br>
                           [{beam_utils,live_opt,<br>
                                [[{bs_put_string,1,{string,[0]}},<br>
                                  {bs_init,<br>
                                      {f,0},<br>
                                      {bs_append,0,8,{field_flags,[]}},<br>
                                      0,<br>
                                      [{integer,8},{x,0}],<br>
                                      {x,1}},<br>
                                  {label,2}],<br>
                                 2,<br>
                                 {1,{1,1,nil,nil}},<br>
                                 [{block,<br>
                                      [{'%live',2},<br>
                                       {set,[{x,0}],[{x,1}],move},<br>
                                       {'%live',1}]},<br>
                                  return]],<br>
                                [{file,"beam_utils.erl"},{line,639}]},<br>
                            {beam_utils,live_opt,1,<br>
                                [{file,"beam_utils.erl"},{line,205}]},<br>
                            {beam_block,function,2,<br>
                                [{file,"beam_block.erl"},{line,38}]},<br>
                            {lists,mapfoldl,3,<br>
                                [{file,"lists.erl"},{line,1329}]},<br>
                            {beam_block,module,2,<br>
                                [{file,"beam_block.erl"},{line,29}]},<br>
                            {compile,'-select_passes/2-anonymous-2-',2,<br>
                                [{file,"compile.erl"},{line,476}]},<br>
                            {compile,'-internal_comp/4-anonymous-1-',2,<br>
                                [{file,"compile.erl"},{line,276}]},<br>
                            {compile,fold_comp,3,<br>
                                [{file,"compile.erl"},{line,294}]}]}}},<br>
               [{compile,'-select_passes/2-anonymous-2-',2,<br>
                    [{file,"compile.erl"},{line,476}]},<br>
                {compile,'-internal_comp/4-anonymous-1-',2,<br>
                    [{file,"compile.erl"},{line,276}]},<br>
                {compile,fold_comp,3,[{file,"compile.erl"},{line,294}]},<br>
                {compile,internal_comp,4,[{file,"compile.erl"},{line,278}]},<br>
                {compile,'-do_compile/2-anonymous-0-',2,<br>
                    [{file,"compile.erl"},{line,152}]}]}<br>
<br>
<br>
The clause was probably commented-out because at this point in the code, no bs_put_string instruction has been generated yet when compiling from Erlang.<br>
<br>
This bug was reported by Loïc Hoguin.<br>
<br>
        git fetch <a href="https://github.com/nox/otp.git" target="_blank">https://github.com/nox/otp.git</a> fix-bs_put_string-renaming<br>
<br>
        <a href="https://github.com/nox/otp/compare/erlang:maint...fix-bs_put_string-renaming" target="_blank">https://github.com/nox/otp/compare/erlang:maint...fix-bs_put_string-renaming</a><br>
        <a href="https://github.com/nox/otp/compare/erlang:maint...fix-bs_put_string-renaming.patch" target="_blank">https://github.com/nox/otp/compare/erlang:maint...fix-bs_put_string-renaming.patch</a><br>
<br>
Regards,<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Anthony Ramine<br>
<br>
_______________________________________________<br>
erlang-bugs mailing list<br>
<a href="mailto:erlang-bugs@erlang.org">erlang-bugs@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-bugs" target="_blank">http://erlang.org/mailman/listinfo/erlang-bugs</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Björn Gustavsson, Erlang/OTP, Ericsson AB
</div>