This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

determining if a variable is defined or not

Hi,

using one simple list, located in the external sdram device, the program is not able to figure out if the pItemNext from the list is defined or not... Therefore I always get an data abort error.

LISTITEM* pItemNext = (LITEM*)0;

/* the first item in the list will be defined... */

/* second item in the list is not defined;
the value of pItemNext = 0xE59FF018 */
pItemNext = pItem->pNextItem;


/* while loop will be executed for this item which is
not defined*/
while(pItemNext != (LITEM *)0)
{
  /* -> data abort error */
  pItemNext->data -= 1;
  pItemNext = pItem->pNextItem;
}


How is it possible to get the while loop working? At the moment the while-loop will be executed for the pItemNext = 0xE59FF018... which is wrong.

best regards
Hannes

Parents
  • Very true!

    On your ARM target, it happens to result in a "data abort error"; on a PC, it could give a "General Protection Fault"; etc, etc,...

    If it so happened tha the uninitialised pointer happened to point to some "real" memory, you would get all sorts of weird & wonderful bugs due to data corruption...

Reply
  • Very true!

    On your ARM target, it happens to result in a "data abort error"; on a PC, it could give a "General Protection Fault"; etc, etc,...

    If it so happened tha the uninitialised pointer happened to point to some "real" memory, you would get all sorts of weird & wonderful bugs due to data corruption...

Children
No data