diff --git a/compile.c b/compile.c index 4b36e4ebd1..df258da772 100644 --- a/compile.c +++ b/compile.c @@ -984,7 +984,7 @@ rb_iseq_compile_prism_node(rb_iseq_t * iseq, pm_scope_node_t *scope_node, pm_par constants[index] = rb_intern3((const char *) constant->start, constant->length, encoding); } - scope_node->constants = (void *)constants; + scope_node->constants = constants; CHECK(rb_translate_prism(iseq, scope_node, ret)); free(constants); diff --git a/prism_compile.c b/prism_compile.c index 4d54ea34ad..e8e9890f13 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -2467,7 +2467,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret, st_insert(index_lookup_table, constant_id, i); } - scope_node->index_lookup_table = (void *)index_lookup_table; + scope_node->index_lookup_table = index_lookup_table; ISEQ_BODY(iseq)->param.lead_num = (int)requireds_list.size; ISEQ_BODY(iseq)->param.opt_num = (int)optionals_list.size; diff --git a/prism_compile.h b/prism_compile.h index dcafa85555..d307807b84 100644 --- a/prism_compile.h +++ b/prism_compile.h @@ -11,10 +11,8 @@ typedef struct pm_scope_node { pm_constant_id_list_t locals; pm_parser_t *parser; - // We don't have the CRuby types ID and st_table within Prism - // so we use void * - void *constants; // ID *constants - void *index_lookup_table; // st_table *index_lookup_table + ID *constants; + st_table *index_lookup_table; } pm_scope_node_t; void pm_scope_node_init(const pm_node_t *node, pm_scope_node_t *scope, pm_scope_node_t *previous, pm_parser_t *parser);