[erlang-bugs] R12B-0 Compiler issues

Bjorn Gustavsson bjorn@REDACTED
Tue Jan 15 16:25:15 CET 2008


"Chih - Wei  Yu [ MTN - Innovation Centre ]" <yu_c@REDACTED> writes:

> I've provided the code that is reporting the error when compiling. I did
> see other 'similar' issues raised but would like to raise it again.
> [Code]
> 
> encode_octet_string( <<OctetString/binary>>, Len ) ->
> <<OctetString:Len/binary-unit:8>>;  % The compiler reports an error for
> this line of code 
> 
> encode_octet_string( [H|T], Len )
> 
> ->
> 
>     B  = list_to_binary( [H|T] ), 
> 
>     << B:Len/binary-unit:8>>
> % However, for this line of code it does not report an error.
> 
> ;
> 
> encode_octet_string( _ANY, _ ) -> <<>>.
> 

Thanks for the new test case. Bjorn's law - "If it isn't tested,
it doesn't work" - has again been proved. :-)

Your other code example is not complete, so I haven't verified, but
it seems to be the same bug that I have already fixed.

The attached patch should fix all found bugs in beam_bsm.erl. It
should be applied to the unchanged beam_bsm.erl in R12B-0. 

/Bjorn
-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB

-------------- next part --------------
A non-text attachment was scrubbed...
Name: t2
Type: application/octet-stream
Size: 2163 bytes
Desc: Cumulative patch for beam_bsm.erl
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20080115/80d1bdc9/attachment.obj>


More information about the erlang-bugs mailing list