[erlang-bugs] Guard clauses using not, binaries and andalso blows up the compiler chain

José Valim <>
Sat Oct 27 12:16:40 CEST 2012


Hello everyone,

The following function cannot compile on Erlang R15B02:

    format(Datetime, << H, T / binary >>) when not ((H >= $a) andalso (H =<
$z)) andalso
        not ((H >= $A) andalso (H =< $Z)) ->
      { Datetime, T }.

Here is a snippet of the failure:



format_test.erl:none: internal error in v3_codegen;
crash reason: {{case_clause,

                {'EXIT',
                 {function_clause,
                  [{v3_codegen,bsm_rename_ctx,

I believe the current code to be valid Erlang and it should not blow up the
compiler chain. :)
Furthermore, simply adding other clauses to this function (without touching
it) makes the error go away.

I have put more information about the failure and a full sample module in a
gist: https://gist.github.com/dd4c1240a1510711b26a
I tried to further debug the issue, but I could not pinpoint exactly the
failure. Let me know if I can help any further.

Thanks for your time,

PS: I have sent this same e-mail one week ago but it didn't appear on the
erlang-bugs mailing list. So I am sending it again. Apologies if it appears
twice.

*
José Valim
www.plataformatec.com.br
Founder and Lead Developer
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20121027/f8c46ffa/attachment.html>


More information about the erlang-bugs mailing list