* (create_mem_region): Disallow useless empty region. Regions are
half-open intervals, so allow [A..B) [B..C) as non-overlapping.
+2002-02-13 Andrew Cagney <ac131313@redhat.com>
+
+ From 2002-01-18 Greg McGary <greg@mcgary.org>:
+ * (create_mem_region): Disallow useless empty region. Regions are
+ half-open intervals, so allow [A..B) [B..C) as non-overlapping.
+
2002-02-13 Michael Chastain <mec@shout.net>
* defs.h: Kill CONST_PTR.
{
struct mem_region *n, *new;
- if (lo > hi)
+ /* lo == hi is a useless empty region */
+ if (lo >= hi)
{
- printf_unfiltered ("invalid memory region\n");
+ printf_unfiltered ("invalid memory region: low >= high\n");
return NULL;
}
while (n)
{
/* overlapping node */
- if ((lo >= n->lo && lo <= n->hi) ||
- (hi >= n->lo && hi <= n->hi))
+ if ((lo >= n->lo && lo < n->hi) ||
+ (hi > n->lo && hi <= n->hi))
{
printf_unfiltered ("overlapping memory region\n");
return NULL;