cvsuser 04/11/15 07:46:04
Modified: imcc pbc.c
Log:
remove memory leak w Sub PMCs
Revision Changes Path
1.98 +2 -5 parrot/imcc/pbc.c
Index: pbc.c
===================================================================
RCS file: /cvs/public/parrot/imcc/pbc.c,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -r1.97 -r1.98
--- pbc.c 15 Nov 2004 10:30:32 -0000 1.97
+++ pbc.c 15 Nov 2004 15:46:04 -0000 1.98
@@ -598,16 +598,13 @@
class = "Coroutine";
sprintf(buf, "%s %s %d %d %d %d", class, real_name, offs, len,
r->pcc_sub->pragma, ns_const);
- pfc = malloc(sizeof(struct PackFile_Constant));
+ k = PDB_extend_const_table(interpreter);
+ pfc = interpreter->code->const_table->constants[k];
rc = PackFile_Constant_unpack_pmc(interpreter,
interpreter->code->const_table, pfc, (opcode_t*)buf);
if (!rc)
fatal(1, "add_const_pmc", "PackFile_Constant error\n");
-
- k = PDB_extend_const_table(interpreter);
- interpreter->code->const_table->constants[k]->type = PFC_PMC;
- interpreter->code->const_table->constants[k]->u.key = pfc->u.key;
globals.cs->subs->pmc_const = k;
debug(interpreter, DEBUG_PBC_CONST,