valgrind findings

This commit is contained in:
John Kerl 2017-02-09 18:45:30 -05:00
parent d054cad7cd
commit bd30d8a40c
2 changed files with 5 additions and 2 deletions

View file

@ -56,8 +56,6 @@ local_stack_frame_t* local_stack_frame_enter(local_stack_frame_t* pframe) {
// ----------------------------------------------------------------
void local_stack_frame_exit (local_stack_frame_t* pframe) {
MLR_INTERNAL_CODING_ERROR_UNLESS(mlhmmv_xvalue_is_absent_and_nonterminal(&pframe->pvars[0].xvalue));
for (int i = 0; i < pframe->size; i++)
mlhmmv_xvalue_free(&pframe->pvars[i].xvalue);
if (!pframe->ephemeral) {
pframe->in_use = FALSE;
LOCAL_STACK_TRACE(printf("LOCAL STACK FRAME NON-EPH EXIT %p %d\n", pframe, pframe->size));

View file

@ -189,6 +189,11 @@ static inline void local_stack_subframe_exit(local_stack_frame_t* pframe, int co
LOCAL_STACK_TRACE(printf("LOCAL STACK SUBFRAME %p EXIT %d->%d\n",
pframe, pframe->subframe_base, pframe->subframe_base-count));
pframe->subframe_base -= count;
local_stack_frame_entry_t* psubframe = &pframe->pvars[pframe->subframe_base];
for (int i = 0; i < count; i++) {
local_stack_frame_entry_t* pentry = &psubframe[i];
mlhmmv_xvalue_free(&pentry->xvalue);
}
}
// ================================================================