aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjforest2007-11-13 17:04:27 +0000
committerjforest2007-11-13 17:04:27 +0000
commitd04ad26f4bb424581db2bbadef715fef491243b3 (patch)
treed827f79e92135697525b29ba99469f8dc9f80451
parentba544632f7a3ef83ec5e0e042a9529864923ddf7 (diff)
Correcting a segfault on amd64 arch with native compiler of ocaml 3.10
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@10319 85f007b7-540e-0410-9357-904b9bb8a0f7
-rw-r--r--contrib/recdef/recdef.ml411
1 files changed, 6 insertions, 5 deletions
diff --git a/contrib/recdef/recdef.ml4 b/contrib/recdef/recdef.ml4
index 318cde7730..8dc0705988 100644
--- a/contrib/recdef/recdef.ml4
+++ b/contrib/recdef/recdef.ml4
@@ -558,11 +558,12 @@ let rec introduce_all_equalities func eqs values specs bound le_proofs
(heq::cond_eqs)] g;;
let string_match s =
- try
- for i = 0 to 3 do
- if String.get s i <> String.get "Acc_" i then failwith "string_match"
- done;
- with Invalid_argument _ -> failwith "string_match"
+ if String.length s < 3 then failwith "string_match";
+ try
+ for i = 0 to 3 do
+ if String.get s i <> String.get "Acc_" i then failwith "string_match"
+ done;
+ with Invalid_argument _ -> failwith "string_match"
let retrieve_acc_var g =
(* Julien: I don't like this version .... *)