Hi, I'm trying to get some insight on what could be causing a stack underflow error. I have some code that looks like
Code:
void * func1(a_struct s)
{
.....
printf("s = 0x%p.\n", s);
printf("&s = 0x%p.\n", &s);
foo = func2(s);
.....
return foo;
}
void * func2(a_struct s)
{
printf("s = 0x%p.\n", s);
printf("&s = 0x%p.\n", &s);
......
return foo;
}
func1 prints out 's' just fine but in func2 I get a stack underflow when trying to print s or &s. I can tell it's an underflow from looking at the assembly. A store instruction is getting called to store a register val just before the start of the stack. This happens with any kind of reference to 's' in func2.
Anyone have any idea what could be going on?