Skip to content

Commit

Permalink
[PRISM] Use xcalloc for iseq id table
Browse files Browse the repository at this point in the history
We use xfree on the other end, so we need to use a form of xmalloc here.

Co-authored-by: Matthew Draper <matthew@trebex.net>
  • Loading branch information
jhawthorn and matthewd committed Dec 13, 2023
1 parent b55de59 commit 02528f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion prism_compile.c
Expand Up @@ -4663,7 +4663,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret,
const VALUE default_values = rb_ary_hidden_new(1);
const VALUE complex_mark = rb_str_tmp_new(0);

ID *ids = calloc(keywords_list->size, sizeof(ID));
ID *ids = xcalloc(keywords_list->size, sizeof(ID));

for (size_t i = 0; i < keywords_list->size; i++, local_index++) {
pm_node_t *keyword_parameter_node = keywords_list->nodes[i];
Expand Down

0 comments on commit 02528f6

Please sign in to comment.