* i386.c (legitimate_address_p): Verify modes of base and index.

From-SVN: r25209
This commit is contained in:
Richard Henderson 1999-02-14 15:13:11 -08:00 committed by Richard Henderson
parent 59be65f6b5
commit c954bd0157
2 changed files with 17 additions and 1 deletions

View File

@ -1,3 +1,7 @@
Sun Feb 14 23:12:10 1999 Richard Henderson <rth@cygnus.com>
* i386.c (legitimate_address_p): Verify modes of base and index.
Sun Feb 14 23:01:28 1999 Richard Henderson <rth@cygnus.com>
* i386.c (legitimate_pic_address_disp_p): Remove static.

View File

@ -2601,7 +2601,7 @@ legitimate_address_p (mode, addr, strict)
}
if (GET_CODE (addr) == REG || GET_CODE (addr) == SUBREG)
base = addr;
base = addr;
else if (GET_CODE (addr) == PLUS)
{
@ -2691,6 +2691,12 @@ legitimate_address_p (mode, addr, strict)
return FALSE;
}
if (GET_MODE (base) != Pmode)
{
ADDR_INVALID ("Base is not in Pmode.\n", base);
return FALSE;
}
if ((strict && ! REG_OK_FOR_BASE_STRICT_P (base))
|| (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (base)))
{
@ -2712,6 +2718,12 @@ legitimate_address_p (mode, addr, strict)
return FALSE;
}
if (GET_MODE (indx) != Pmode)
{
ADDR_INVALID ("Index is not in Pmode.\n", indx);
return FALSE;
}
if ((strict && ! REG_OK_FOR_INDEX_STRICT_P (indx))
|| (! strict && ! REG_OK_FOR_INDEX_NONSTRICT_P (indx)))
{