[erlang-bugs] bug in bs_put_integer

Fredrik Svahn <>
Thu Dec 20 12:11:07 CET 2007


Thanks. No patch needed, I noticed the badarg and modified the real program
accordingly.

Just out of curiosity, does this imply that the above is something that will
typically generate an error at compile time instead of at run time in
R12B-1? Or will you handle it as a binary when the compiler is sure that is
a binary and not the default integer type? It is probably a common beginners
mistake to forget the TypeSpecifier.

BR /Fredrik

On 20 Dec 2007 11:33:23 +0100, Bjorn Gustavsson <>
wrote:

> "Fredrik Svahn" <> writes:
>
> > Seems similar to the bug reported by Oleg Avdeev on Dec 7, although it
> does
> > not seem like the patch provided then solves this problem. Program
> compiles
> > with R11B-5 but not with R12B-0.
>
> Thanks!
>
> Yes, a similar bug. I did look for more bugs when I prepared that patch,
> but
> I didn't realize that bs_put_integer could be passed a binary.
>
> We will correct the problem in R12B-1. Since the program will fail at
> run-time,
> I suppose that I don't need to post a patch.
>
> /Bjorn
>
> > Problem:
> > ---------
> >
> > $ erlc test2.erl
> > test2: function f/1+10:
> >   Internal consistency check failed - please report this bug.
> >   Instruction: {bs_put_integer,{f,0},
> >                                {integer,8},
> >                                1,
> >                                {field_flags,[unsigned,big]},
> >                                {x,0}}
> >   Error:       {match_context,{x,0}}:
> >
> >
> > Test program:
> > --------------
> > -module(test2).
> > -export([f/1]).
> >
> > f(<<"A", H/binary>>) -> <<"B", H>>.
> >
> >
> > BR /Fredrik Svahn
> > _______________________________________________
> > erlang-bugs mailing list
> > 
> > http://www.erlang.org/mailman/listinfo/erlang-bugs
>
> --
> Björn Gustavsson, Erlang/OTP, Ericsson AB
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20071220/47a17cdb/attachment.html>


More information about the erlang-bugs mailing list