Branch: Tag:

2005-06-09

2005-06-09 09:26:09 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Fixed leak introduced by the new mexec_alloc code.

Rev: src/program.c:1.570

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.569 2005/05/30 12:38:43 mast Exp $ + || $Id: program.c,v 1.570 2005/06/09 09:26:09 grubba Exp $   */      #include "global.h" - RCSID("$Id: program.c,v 1.569 2005/05/30 12:38:43 mast Exp $"); + RCSID("$Id: program.c,v 1.570 2005/06/09 09:26:09 grubba Exp $");   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"
2484:   #endif /* PIKE_USE_MACHINE_CODE && VALGRIND_DISCARD_TRANSLATIONS */    if(p->flags & PROGRAM_OPTIMIZED)    { -  if(p->program) { +    #ifdef PIKE_USE_MACHINE_CODE -  mexec_free(p->program); +  do { +  /* NOTE: Assumes all BAR's are before any FOO. */ + #define BAR(NUMTYPE,TYPE,ARGTYPE,NAME) \ +  if (p->NAME) mexec_free(p->NAME); + #define FOO(NUMTYPE,TYPE,ARGTYPE,NAME) \ +  if (p->NAME) { \ +  dmfree(p->NAME); \ +  break; \ +  } + #include "program_areas.h" +  } while(0);   #else /* PIKE_USE_MACHINE_CODE */ -  +  if(p->program) {    dmfree(p->program); - #endif /* PIKE_USE_MACHINE_CODE */ +     } -  + #endif /* PIKE_USE_MACHINE_CODE */   #define FOO(NUMTYPE,TYPE,ARGTYPE,NAME) p->NAME=0;   #include "program_areas.h"    }else{