Commit c954bd01 by Richard Henderson Committed by Richard Henderson

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

From-SVN: r25209
parent 59be65f6
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> Sun Feb 14 23:01:28 1999 Richard Henderson <rth@cygnus.com>
* i386.c (legitimate_pic_address_disp_p): Remove static. * i386.c (legitimate_pic_address_disp_p): Remove static.
......
...@@ -2601,7 +2601,7 @@ legitimate_address_p (mode, addr, strict) ...@@ -2601,7 +2601,7 @@ legitimate_address_p (mode, addr, strict)
} }
if (GET_CODE (addr) == REG || GET_CODE (addr) == SUBREG) if (GET_CODE (addr) == REG || GET_CODE (addr) == SUBREG)
base = addr; base = addr;
else if (GET_CODE (addr) == PLUS) else if (GET_CODE (addr) == PLUS)
{ {
...@@ -2691,6 +2691,12 @@ legitimate_address_p (mode, addr, strict) ...@@ -2691,6 +2691,12 @@ legitimate_address_p (mode, addr, strict)
return FALSE; 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)) if ((strict && ! REG_OK_FOR_BASE_STRICT_P (base))
|| (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (base))) || (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (base)))
{ {
...@@ -2712,6 +2718,12 @@ legitimate_address_p (mode, addr, strict) ...@@ -2712,6 +2718,12 @@ legitimate_address_p (mode, addr, strict)
return FALSE; 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)) if ((strict && ! REG_OK_FOR_INDEX_STRICT_P (indx))
|| (! strict && ! REG_OK_FOR_INDEX_NONSTRICT_P (indx))) || (! strict && ! REG_OK_FOR_INDEX_NONSTRICT_P (indx)))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment