git.annexia.org
/
ocaml-bitstring.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b546740
)
On fastpath, 32/64 bit zeros must be allocated each time (Hans Ole Rafaelsen).
author
Richard W.M. Jones
<rich@annexia.org>
Fri, 17 Oct 2008 08:57:43 +0000
(08:57 +0000)
committer
Richard W.M. Jones
<rich@annexia.org>
Fri, 17 Oct 2008 08:57:43 +0000
(08:57 +0000)
pa_bitstring.ml
patch
|
blob
|
history
diff --git
a/pa_bitstring.ml
b/pa_bitstring.ml
index
71eabed
..
0c09356
100644
(file)
--- 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 ->
| 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 ->
| 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. *)
| _ -> assert false in
<:expr<
(* Starting offset within the string. *)