Ticket #1528: malloc_boundary.c.diff

File malloc_boundary.c.diff, 1.0 KB (added by Ralf Corsepius, on May 23, 2010 at 5:28:23 AM)

Patch to address problem

  • libcsupport/src/malloc_boundary.c

    RCS file: /usr1/CVS/rtems/cpukit/libcsupport/src/malloc_boundary.c,v
    retrieving revision 1.8
    diff -u -r1.8 malloc_boundary.c
     
    7575{
    7676  void *return_this;
    7777  struct mallocNode *mp = (struct mallocNode *)pointer;
    78   int *fp, *nfp;
     78  intptr_t *fp, *nfp;
    7979  int i;
    8080
    8181  _RTEMS_Lock_allocator();
    8282    mp->memory = mp + 1;
    8383    return_this = mp->memory;
    8484    mp->size = size - (sizeof(struct mallocNode) + SENTINELSIZE);
    85     fp = (int *)&size - 2;
     85    fp = (intptr_t *)&size - 2;
    8686    for (i = 0 ; i < CALLCHAINSIZE ; i++) {
    8787      mp->callChain[i] = fp[1];
    88       nfp = (int *)(fp[0]);
    89       if((nfp <= fp) || (nfp > (int *)(INT32_C(0x1000000) /* 1 << 24 */)))
     88      nfp = (intptr_t *)(fp[0]);
     89      if((nfp <= fp) || (nfp > (intptr_t *)(INT32_C(0x1000000) /* 1 << 24 */)))
    9090       break;
    9191      fp = nfp;
    9292    }