summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2023-12-12 18:34:14 -0800
committerJohn Hawthorn <john@hawthorn.email>2023-12-13 10:20:11 -0800
commit02528f647d4d217a574eb2518dbb925c937dded6 (patch)
tree91e4f71c1a0195a666f0197ce1985f52347b55ef
parentb55de590f3344dcedaafba8bcf2a249c9f0c4fc5 (diff)
[PRISM] Use xcalloc for iseq id table
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>
-rw-r--r--prism_compile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/prism_compile.c b/prism_compile.c
index db4c64ccea..d744f43506 100644
--- a/prism_compile.c
+++ b/prism_compile.c
@@ -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];