summaryrefslogtreecommitdiff
path: root/otherlibs/str
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>2006-01-04 16:55:50 +0000
committerDamien Doligez <damien.doligez-inria.fr>2006-01-04 16:55:50 +0000
commit125ea40d4c63e7bae69e30c2b6ba2b598b1bd5c2 (patch)
tree6884b9b9821851f7f57add043646b54fe4cc85f3 /otherlibs/str
parent3aaf0659a4c172c71cbf4828ed3bb6aa833c53e0 (diff)
downloadocaml-125ea40d4c63e7bae69e30c2b6ba2b598b1bd5c2.tar.gz
fusion 3.09.0 -> 3.09.1
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7307 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/str')
-rw-r--r--otherlibs/str/str.ml4
1 files changed, 3 insertions, 1 deletions
diff --git a/otherlibs/str/str.ml b/otherlibs/str/str.ml
index f443c503ff..31b6232841 100644
--- a/otherlibs/str/str.ml
+++ b/otherlibs/str/str.ml
@@ -227,7 +227,9 @@ let compile fold_case re =
(* Add a new instruction *)
let emit_instr opc arg =
if !progpos >= Array.length !prog then begin
- let nprog = Array.make (2 * Array.length !prog) 0 in
+ let newlen = ref (Array.length !prog) in
+ while !progpos >= !newlen do newlen := !newlen * 2 done;
+ let nprog = Array.make !newlen 0 in
Array.blit !prog 0 nprog 0 (Array.length !prog);
prog := nprog
end;