Skip to content

Commit

Permalink
free IC in js_free_function_def
Browse files Browse the repository at this point in the history
  • Loading branch information
littledivy committed Nov 23, 2023
1 parent b16b435 commit 9059234
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -26815,6 +26815,13 @@ static void js_free_function_def(JSContext *ctx, JSFunctionDef *fd)
js_free(ctx, fd->label_slots);
js_free(ctx, fd->line_number_slots);

/* free ic if unused */
if (fd->ic && fd->ic->count == 0) {
/* we might be recovering after the ic is used
in that case, gc handles freeing */
free_ic(fd->ic);
}

for(i = 0; i < fd->cpool_count; i++) {
JS_FreeValue(ctx, fd->cpool[i]);
}
Expand Down

0 comments on commit 9059234

Please sign in to comment.