[erlang-bugs] Bug in binary append?

Bjorn Gustavsson <>
Sat Dec 8 09:04:54 CET 2007


"Oleg Avdeev" <> writes:

> Hello,
> 
> Seems that there's a bug in R12, while compiling

Thanks for the bug report.

The following patch fixes the problem.

/Bjorn

*** lib/compiler/src/beam_bsm.erl@@/OTP_R12B    Mon Nov 26 20:01:52 2007
--- lib/compiler/src/beam_bsm.erl       Sat Dec  8 08:21:27 2007
***************
*** 269,277 ****
      btb_reaches_match_1(Is, btb_kill([Dst], Regs), D);
  btb_reaches_match_2([{bs_init_bits,{f,0},_,_,_,_,Dst}|Is], Regs, D) ->
      btb_reaches_match_1(Is, btb_kill([Dst], Regs), D);
! btb_reaches_match_2([{bs_append,{f,0},_,_,_,_,_,_,Dst}|Is], Regs, D) ->
      btb_reaches_match_1(Is, btb_kill([Dst], Regs), D);
! btb_reaches_match_2([{bs_private_append,{f,0},_,_,_,_,Dst}|Is], Regs, D) ->
      btb_reaches_match_1(Is, btb_kill([Dst], Regs), D);
  btb_reaches_match_2([{bs_put_integer,{f,0},_,_,_,_}|Is], Regs, D) ->
      btb_reaches_match_1(Is, Regs, D);
--- 269,279 ----
      btb_reaches_match_1(Is, btb_kill([Dst], Regs), D);
  btb_reaches_match_2([{bs_init_bits,{f,0},_,_,_,_,Dst}|Is], Regs, D) ->
      btb_reaches_match_1(Is, btb_kill([Dst], Regs), D);
! btb_reaches_match_2([{bs_append,{f,0},_,_,_,_,Src,_,Dst}=I|Is], Regs, D) ->
!     btb_ensure_not_used([Src], I, Regs),
      btb_reaches_match_1(Is, btb_kill([Dst], Regs), D);
! btb_reaches_match_2([{bs_private_append,{f,0},_,_,Src,_,Dst}=I|Is], Regs, D) ->
!     btb_ensure_not_used([Src], I, Regs),
      btb_reaches_match_1(Is, btb_kill([Dst], Regs), D);
  btb_reaches_match_2([{bs_put_integer,{f,0},_,_,_,_}|Is], Regs, D) ->
      btb_reaches_match_1(Is, Regs, D);


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



More information about the erlang-bugs mailing list