Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions ext/rbs_extension/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ static void declare_type_variables(rbs_parser_t *parser, VALUE variables, VALUE
}

VALUE name_str = rb_sym2str(symbol);
uint8_t *copied_name = (uint8_t *) malloc((size_t) RSTRING_LEN(name_str));
memcpy((void *) copied_name, RSTRING_PTR(name_str), RSTRING_LEN(name_str));

rbs_constant_id_t id = rbs_constant_pool_insert_shared(
rbs_constant_id_t id = rbs_constant_pool_insert_owned(
&parser->constant_pool,
(const uint8_t *) RSTRING_PTR(name_str),
copied_name,
RSTRING_LEN(name_str)
);

Expand Down