From: Richard W.M. Jones Date: Fri, 17 Oct 2008 08:57:43 +0000 (+0000) Subject: On fastpath, 32/64 bit zeros must be allocated each time (Hans Ole Rafaelsen). X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=6a3c84542fe4a1e945a24471accf4d29ad4463a3;hp=b546740ab1251f227428a164b1d1a2273a564e0c;p=ocaml-bitstring.git On fastpath, 32/64 bit zeros must be allocated each time (Hans Ole Rafaelsen). --- diff --git a/pa_bitstring.ml b/pa_bitstring.ml index 71eabed..0c09356 100644 --- a/pa_bitstring.ml +++ b/pa_bitstring.ml @@ -666,9 +666,17 @@ let output_bitmatch _loc bs cases = | 16 -> <:expr< Bitstring.$lid:name$ $lid:data$ o >> | 32 -> - <:expr< Bitstring.$lid:name$ $lid:data$ o 0l >> + <:expr< + (* must allocate a new zero each time *) + let zero = Int32.of_int 0 in + Bitstring.$lid:name$ $lid:data$ o zero + >> | 64 -> - <:expr< Bitstring.$lid:name$ $lid:data$ o 0L >> + <:expr< + (* must allocate a new zero each time *) + let zero = Int64.of_int 0 in + Bitstring.$lid:name$ $lid:data$ o zero + >> | _ -> assert false in <:expr< (* Starting offset within the string. *)