Branch: Tag:

2003-06-09

2003-06-09 16:36:39 by Martin Stjernholm <mast@lysator.liu.se>

Don't MEMCPY zero length blocks, to avoid warnings from memory checkers.

Rev: src/program.c:1.508

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: program.c,v 1.507 2003/06/06 14:35:48 grubba Exp $ + || $Id: program.c,v 1.508 2003/06/09 16:36:39 mast Exp $   */      #include "global.h" - RCSID("$Id: program.c,v 1.507 2003/06/06 14:35:48 grubba Exp $"); + RCSID("$Id: program.c,v 1.508 2003/06/09 16:36:39 mast Exp $");   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"
1491:      #define FOO(NUMTYPE,TYPE,ARGTYPE,NAME) \    size=DO_ALIGN(size, ALIGNOF(TYPE)); \ +  if (p->PIKE_CONCAT (num_, NAME)) \    MEMCPY(data+size,p->NAME,p->PIKE_CONCAT(num_,NAME)*sizeof(p->NAME[0])); \    PIKE_CONCAT(RELOCATE_,NAME)(p, (TYPE *)(data+size)); \    dmfree(p->NAME); \
3907:    IDENTIFIER_NO_THIS_REF;    /* Hide the old variable. */    Pike_compiler->new_program->identifier_references[n].id_flags |= -  ID_STATIC|ID_PRIVATE; +  ID_HIDDEN;    return n2;    }    }
7115:   {    switch(s->type)    { - #if 0 +     case T_OBJECT:    {    struct program *p = s->u.object->prog;
7137: Inside #if 0
   pop_stack();    return p; /* We trust that there is a reference somewhere... */    } - #endif +        case T_FUNCTION:    return program_from_function(s);