Big binary HiPE bad match

Hynek Vychodil hynek@REDACTED
Thu Jun 18 22:07:52 CEST 2009


Hello,
I unfortunately found bug in HiPE big binary matching.

Here is test case:

-module(bad_match).

-export([test/0]).

test() ->
    P = make_pidle(100000000),
    <<_:4/bytes, I:32, _/bytes>> = P,
    I.

make_pidle(N) -> make_pidle(<<>>, 0, N).

make_pidle(P, N, N) -> P;
make_pidle(P, I, N) -> make_pidle(<<P/bytes, I:32>>, I+1, N).

$ erl
Erlang R13B (erts-5.7.1) [source] [smp:2:2] [rq:2] [async-threads:0] [hipe]
[kernel-poll:false]

Eshell V5.7.1  (abort with ^G)
1> c(bad_match).
{ok,bad_match}
2> bad_match:test().
1
3> c(bad_match,native).
{ok,bad_match}
4> bad_match:test().
** exception error: no match of right hand side value
<<0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,6,
                                                        0,...>>
     in function  bad_match:test/0
     in call from io:format/2

Best regards.
-- 
--Hynek (Pichi) Vychodil

Analyze your data in minutes. Share your insights instantly. Thrill your
boss.  Be a data hero!
Try Good Data now for free: www.gooddata.com


More information about the erlang-bugs mailing list