From 208c35e5b83d85e17dcbd0b6f3dbcc1f2d28b1bd Mon Sep 17 00:00:00 2001 From: varobert Date: Wed, 4 Jul 2012 08:48:17 +0000 Subject: checklink: more defensive is_padding git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1952 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- checklink/Check.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'checklink') diff --git a/checklink/Check.ml b/checklink/Check.ml index b5f1f3b..9608767 100644 --- a/checklink/Check.ml +++ b/checklink/Check.ml @@ -2987,7 +2987,8 @@ let string_of_range a b = "[0x" ^ Printf.sprintf "%08lx" a ^ " - 0x" ^ let is_padding bs start stop = let bs_start = start * 8 in let bs_length = (stop - start + 1) * 8 in - is_zeros (Bitstring.subbitstring bs bs_start bs_length) bs_length + start <= stop && + is_zeros (Bitstring.subbitstring bs bs_start bs_length) bs_length (** This functions goes through the list of checked bytes, and tries to find padding in it. That is, it takes pairs of chunks in order, and adds a -- cgit v1.2.3