Stack corruption

Hello,

I am working on AT91SAM9G20, Keil 5.10. I am passing a constant structure pointer
to a function.

typedef struct
{
   int Test;
   int OkFlag;
}StructNode;

typedef const StructNode *const Node_t

after passing the node 3 times recursively through a function

stack data is getting corrupted.

Am I doing any mistake, Please suggest.

Parents
  • So have you verified that the stack is big enough?
    And have you verified if there are other structures that are neighbour with the stack and might overwrite the stack?
    And have you verified your use of pointers or arrays to check for use of invalid pointers or out-of-bounds accesses to arrays?

Reply
  • So have you verified that the stack is big enough?
    And have you verified if there are other structures that are neighbour with the stack and might overwrite the stack?
    And have you verified your use of pointers or arrays to check for use of invalid pointers or out-of-bounds accesses to arrays?

Children
More questions in this forum