array. accessing 0xFFFFFFFF element
I have code that is similar to the below.
int foo (unsigned int a)
{
struct tid{
int id;
char abd[8];
};
int ret = 0;
struct tid arr[256];
ret = arr[a];
...
}
The value of a passed to foo is 0xFFFFFFFF. Now, since we are accessing a
memory location outside of the stack, I would assume the system would
fault, but it is not. I would like to know a direction in which I could
look to find out how this could work. The machine under consideration is a
MIPS 4K, with 32 bit addressing and 256 MB of RAM. I am cross compiling
the code on a x86 PC using gcc.
No comments:
Post a Comment