From: Julian Seward Date: Fri, 6 Mar 2015 09:19:38 +0000 (+0000) Subject: Update comment about range checks with observations from Florian. X-Git-Tag: svn/VALGRIND_3_11_0~610 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6e9e1112dc719dfe88c2363b2e22d259a507bbd6;p=thirdparty%2Fvalgrind.git Update comment about range checks with observations from Florian. No functional change. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14982 --- diff --git a/coregrind/m_debuginfo/image.c b/coregrind/m_debuginfo/image.c index 964c6338a5..819a77097e 100644 --- a/coregrind/m_debuginfo/image.c +++ b/coregrind/m_debuginfo/image.c @@ -405,6 +405,12 @@ static inline Bool is_in_CEnt ( const CEnt* cent, DiOffT off ) --> x-LO >= 0 && x-LO < LO+N-LO --> x-LO >= 0 && x-LO < N --> x-LO < N + This is however only valid when the original bounds, that is, LO + .. LO+N-1, do not wrap around the end of the address space. That + is, we require that LO <= LO+N-1. But that's OK .. we don't + expect wraparounds in CEnts or for that matter any object + allocated from C-land. See Hacker's Delight, Chapter 4.1, + "Checking Bounds of Integers", for more details. */ return off - cent->off < cent->used; }