[erlang-questions] Re: Erlang/OTP R14B01 has been released
Björn Gustavsson
bgustavsson@REDACTED
Tue Dec 14 15:32:37 CET 2010
On Sun, Dec 12, 2010 at 6:51 PM, Zvi <zvi.avraham@REDACTED> wrote:
> RE: OTP-8865 Code such as foo(A) -> <<A:0>> would crash the compiler.
>
> It seems that compiler will totally ignore type of A in this case:
>
> Eshell V5.8.2 (abort with ^G)
> 1> F = fun(A) -> <<A:0>> end.
> #Fun<erl_eval.6.13229925>
> 2>
> 2> F(0).
> <<>>
> 3> F(1).
> <<>>
> 4> F(10000).
> <<>>
> 5> F(1.4).
> <<>>
> 6> F(add).
> <<>>
> 7> F(kuku).
> <<>>
> 8>
> 8> F("adfd").
> <<>>
> 9>
> 9> F({1,2}).
> <<>>
> 10>
>
We will fix this bug in R14B02.
By the way, the bug is in the run-time system, not in the compiler.
The compiler emits the correct instruction, but that instruction
does not bother to check the type if the width is zero.
--
Björn Gustavsson, Erlang/OTP, Ericsson AB
More information about the erlang-questions
mailing list