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.
This commit is contained in:
Andrew Cagney 2002-02-13 19:00:47 +00:00
parent 6c6ea35e34
commit b6d1a1d526
2 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,9 @@
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.

View File

@ -45,9 +45,10 @@ create_mem_region (CORE_ADDR lo, CORE_ADDR hi,
{
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;
}
@ -55,8 +56,8 @@ create_mem_region (CORE_ADDR lo, CORE_ADDR hi,
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;