summaryrefslogtreecommitdiffstats
path: root/src/state.c
diff options
context:
space:
mode:
authorTing-Wei Lan <lantw44@gmail.com>2015-12-31 19:16:00 +0800
committerTing-Wei Lan <lantw44@gmail.com>2015-12-31 19:16:29 +0800
commit64a1eb052290116cdc150a33fcea7bc0f2b4ad48 (patch)
tree63489fa548d72bc3c091e333215ce8e85b2c6371 /src/state.c
parentf4f88342f1cda6491bf9f2f06fa859f51d7a4297 (diff)
downloadcompiler2015-64a1eb052290116cdc150a33fcea7bc0f2b4ad48.tar
compiler2015-64a1eb052290116cdc150a33fcea7bc0f2b4ad48.tar.gz
compiler2015-64a1eb052290116cdc150a33fcea7bc0f2b4ad48.tar.bz2
compiler2015-64a1eb052290116cdc150a33fcea7bc0f2b4ad48.tar.lz
compiler2015-64a1eb052290116cdc150a33fcea7bc0f2b4ad48.tar.xz
compiler2015-64a1eb052290116cdc150a33fcea7bc0f2b4ad48.tar.zst
compiler2015-64a1eb052290116cdc150a33fcea7bc0f2b4ad48.zip
Properly deallocate the register pool
Diffstat (limited to 'src/state.c')
-rw-r--r--src/state.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/state.c b/src/state.c
index 0c643f6..9ac55f3 100644
--- a/src/state.c
+++ b/src/state.c
@@ -11,6 +11,7 @@ void ccmmc_state_init (CcmmcState *state)
state->table = NULL;
state->line_number = 1;
state->asm_output = NULL;
+ state->reg_pool = NULL;
}
void ccmmc_state_fini (CcmmcState *state)
@@ -24,6 +25,9 @@ void ccmmc_state_fini (CcmmcState *state)
if (state->asm_output != NULL) {
fclose(state->asm_output);
}
+ if (state->reg_pool != NULL) {
+ ccmmc_register_fini(state->reg_pool);
+ }
}
// vim: set sw=4 ts=4 sts=4 et: