summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2014-06-23 19:14:26 +0200
committerSebastian Dröge <sebastian@centricular.com>2014-06-23 19:14:26 +0200
commit5f4ebb54fe6f76fd463016ecc6104f14d30099a3 (patch)
tree1c0b24515ef2e873195077b90d508b6383da9384
parent29a8b8c11a0cc8e8438e80160ac0f48c057eeaa5 (diff)
orccompiler: If compiling a program twice, first free the results of the previous compilation
-rw-r--r--orc/orccompiler.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/orc/orccompiler.c b/orc/orccompiler.c
index d338a54..a0fa305 100644
--- a/orc/orccompiler.c
+++ b/orc/orccompiler.c
@@ -199,6 +199,16 @@ orc_program_compile_full (OrcProgram *program, OrcTarget *target,
return ORC_COMPILE_RESULT_UNKNOWN_PARSE;
}
+ if (program->orccode) {
+ orc_code_free (program->orccode);
+ program->orccode = NULL;
+ }
+
+ if (program->asm_code) {
+ free (program->asm_code);
+ program->asm_code = NULL;
+ }
+
compiler = malloc (sizeof(OrcCompiler));
memset (compiler, 0, sizeof(OrcCompiler));