...Strange Problem...



I've the following problem with my arm9:

insede myclass, two methods:

int funcB() //private
{
int ret;

// do something setting ret

cout<<"debug1"<<endl;
return ret;
}


int funcA() //pubblic
{
int ret;
//...
ret=funcB();
cout<<"debug2"<<endl;
//...

return ret;
}

From main:
....
ret=myclass.funcA();
....

When I start program assuming, inside funcB(), ret=0:
debug1
debug2

When I start program assuming, inside funcB(), ret=1:
debug1
debug2

if during the same execution I change status of ret inside funcB(), from 1
to 0, I can see:
debug1
debug2


if during the another execution I change status of ret inside funcB(), from
0 to 1, I can see:
debug1
Segmentation fault

!!!! Why ????

My working conditions: freescale arm9 mxL, 16Mb flash, 16Mb sdram

Thanks and MerryChristmas






.



Relevant Pages