diff options
author | varobert <varobert@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2012-07-04 08:48:17 +0000 |
---|---|---|
committer | varobert <varobert@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2012-07-04 08:48:17 +0000 |
commit | 208c35e5b83d85e17dcbd0b6f3dbcc1f2d28b1bd (patch) | |
tree | 030d856f992867339d2bbdd54899521d461eb58f /checklink | |
parent | bdacf3abbea236a33b687008d5d954585612d32f (diff) |
checklink: more defensive is_padding
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1952 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'checklink')
-rw-r--r-- | checklink/Check.ml | 3 |
1 files changed, 2 insertions, 1 deletions
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 |