mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 22:48:57 +08:00
* interp.c (load_mem): If we get a load from an out of range
address, abort. (store_mem): Likewise for stores. (max_mem): New variable.
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
Fri May 16 16:36:17 1997 Jeffrey A Law (law@cygnus.com)
|
||||||
|
|
||||||
|
* interp.c (load_mem): If we get a load from an out of range
|
||||||
|
address, abort.
|
||||||
|
(store_mem): Likewise for stores.
|
||||||
|
(max_mem): New variable.
|
||||||
|
|
||||||
Tue May 6 13:24:36 1997 Jeffrey A Law (law@cygnus.com)
|
Tue May 6 13:24:36 1997 Jeffrey A Law (law@cygnus.com)
|
||||||
|
|
||||||
* mn10300_sim.h: Fix ordering of bits in the PSW.
|
* mn10300_sim.h: Fix ordering of bits in the PSW.
|
||||||
|
@ -33,6 +33,7 @@ struct hash_entry
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int max_mem = 0;
|
||||||
struct hash_entry hash_table[MAX_HASH+1];
|
struct hash_entry hash_table[MAX_HASH+1];
|
||||||
|
|
||||||
|
|
||||||
@ -241,6 +242,9 @@ load_mem_big (addr, len)
|
|||||||
{
|
{
|
||||||
uint8 *p = addr + State.mem;
|
uint8 *p = addr + State.mem;
|
||||||
|
|
||||||
|
if (addr > max_mem)
|
||||||
|
abort ();
|
||||||
|
|
||||||
switch (len)
|
switch (len)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
@ -263,6 +267,9 @@ load_mem (addr, len)
|
|||||||
{
|
{
|
||||||
uint8 *p = addr + State.mem;
|
uint8 *p = addr + State.mem;
|
||||||
|
|
||||||
|
if (addr > max_mem)
|
||||||
|
abort ();
|
||||||
|
|
||||||
switch (len)
|
switch (len)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
@ -286,6 +293,9 @@ store_mem (addr, len, data)
|
|||||||
{
|
{
|
||||||
uint8 *p = addr + State.mem;
|
uint8 *p = addr + State.mem;
|
||||||
|
|
||||||
|
if (addr > max_mem)
|
||||||
|
abort ();
|
||||||
|
|
||||||
switch (len)
|
switch (len)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
@ -314,6 +324,7 @@ sim_size (power)
|
|||||||
if (State.mem)
|
if (State.mem)
|
||||||
free (State.mem);
|
free (State.mem);
|
||||||
|
|
||||||
|
max_mem = 1 << power;
|
||||||
State.mem = (uint8 *) calloc (1, 1 << power);
|
State.mem = (uint8 *) calloc (1, 1 << power);
|
||||||
if (!State.mem)
|
if (!State.mem)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user