|
From: <sv...@va...> - 2015-03-06 09:19:46
|
Author: sewardj
Date: Fri Mar 6 09:19:38 2015
New Revision: 14982
Log:
Update comment about range checks with observations from Florian.
No functional change.
Modified:
trunk/coregrind/m_debuginfo/image.c
Modified: trunk/coregrind/m_debuginfo/image.c
==============================================================================
--- trunk/coregrind/m_debuginfo/image.c (original)
+++ trunk/coregrind/m_debuginfo/image.c Fri Mar 6 09:19:38 2015
@@ -405,6 +405,12 @@
--> 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;
}
|