cvsuser 04/11/04 01:07:58
Modified: imcc imc.c imcc.l main.c parser_util.c
Log:
fix double free
The emitter closing and unit freeing had wrong order and additionally
emitter close code was run twice.
Revision Changes Path
1.75 +1 -2 parrot/imcc/imc.c
Index: imc.c
===================================================================
RCS file: /cvs/public/parrot/imcc/imc.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- imc.c 1 Oct 2004 14:21:33 -0000 1.74
+++ imc.c 4 Nov 2004 09:07:58 -0000 1.75
@@ -58,8 +58,6 @@
fprintf(stderr, "imc.c: imc_compile_all_units()\n");
#endif
- UNUSED(ins_next);
- UNUSED(ins);
for (unit = interp->imc_info->imc_units; unit; unit = unit_next) {
unit_next = unit->next;
#if IMC_TRACE
@@ -70,6 +68,7 @@
imc_close_unit(interp, unit);
}
+ emit_close(interp);
/* All done with compilation, now free instructions and other structures */
for (unit = interp->imc_info->imc_units; unit;) {
1.119 +0 -1 parrot/imcc/imcc.l
Index: imcc.l
===================================================================
RCS file: /cvs/public/parrot/imcc/imcc.l,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -r1.118 -r1.119
--- imcc.l 4 Nov 2004 08:21:06 -0000 1.118
+++ imcc.l 4 Nov 2004 09:07:58 -0000 1.119
@@ -901,7 +901,6 @@
yyparse((void *) interp);
imc_compile_all_units(interp);
imc_cleanup(interp);
- emit_close(interp);
yy_switch_to_buffer(buffer);
}
1.82 +0 -1 parrot/imcc/main.c
Index: main.c
===================================================================
RCS file: /cvs/public/parrot/imcc/main.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -r1.81 -r1.82
--- main.c 1 Nov 2004 15:35:33 -0000 1.81
+++ main.c 4 Nov 2004 09:07:58 -0000 1.82
@@ -523,7 +523,6 @@
imc_compile_all_units(interpreter);
imc_cleanup(interpreter);
- emit_close(interpreter);
fclose(yyin);
info(interpreter, 1, "%ld lines compiled.\n", line);
1.79 +0 -1 parrot/imcc/parser_util.c
Index: parser_util.c
===================================================================
RCS file: /cvs/public/parrot/imcc/parser_util.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -r1.78 -r1.79
--- parser_util.c 30 Oct 2004 09:15:42 -0000 1.78
+++ parser_util.c 4 Nov 2004 09:07:58 -0000 1.79
@@ -462,7 +462,6 @@
/* XXX where to put constants */
yyparse((void *) interp);
imc_compile_all_units(interp);
- emit_close(interp);
#ifdef EVAL_TEST
pc = (opcode_t *) interp->code->byte_code;