[erlang-bugs] Internal consistency check failed

tty <>
Wed Apr 23 22:40:57 CEST 2008


Hello,

Compiling the following code generated an internal consistency check failed.

=============================================
-module(test0).

-compile([export_all]).

parse(<<A:8, R/binary>>) ->
    parse(R, [A]).

parse(<<".", R/binary>>, Acc) ->
    {Acc, <<".", R>>};
parse(<<A:8, R/binary>>, Acc) ->
    parse(R, Acc ++ [A]).
=============================================

The output from erlc is:

=============================================
  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}}:
=============================================

Changing 
     parse(<<".", R/binary>>, Acc) ->
          {Acc, <<".", R>>};

to
     parse(<<".", R/binary>>, Acc) ->
          {Acc, <<".", R/binary>>};

works fine. 

Changing 
     parse(<<".", R/binary>>, Acc) ->
          {Acc, <<".", R>>};

to
     parse(<<".", R>>, Acc) ->
          {Acc, <<".", R>>};

also works fine.

Running with
Erlang (SMP,ASYNC_THREADS,HIPE) (BEAM) emulator version 5.6
on Mac OS X v10.5.2

Thanks,

Tee



More information about the erlang-bugs mailing list