diff options
author | Kevin Newton <[email protected]> | 2023-09-27 15:21:45 -0400 |
---|---|---|
committer | Kevin Newton <[email protected]> | 2023-09-27 15:41:05 -0400 |
commit | 175ac32c62101c601ab701f08e3a781b3b088e62 (patch) | |
tree | dacebc635daa881df3c5b616b54a1089645c59c7 /compile.c | |
parent | 29555130951435c57fd9a6ab932192a3d180ee0d (diff) |
Use new constant pool layout for prism
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -874,12 +874,9 @@ rb_iseq_compile_prism_node(rb_iseq_t * iseq, const pm_node_t *node, pm_parser_t ID *constants = calloc(parser->constant_pool.size, sizeof(ID)); rb_encoding *encoding = rb_enc_find(parser->encoding.name); - for (size_t index = 0; index < parser->constant_pool.capacity; index++) { - pm_constant_t constant = parser->constant_pool.constants[index]; - - if (constant.id != 0) { - constants[constant.id - 1] = rb_intern3((const char *) constant.start, constant.length, encoding); - } + for (uint32_t index = 0; index < parser->constant_pool.size; index++) { + pm_constant_t *constant = &parser->constant_pool.constants[index]; + constants[index] = rb_intern3((const char *) constant->start, constant->length, encoding); } pm_compile_context_t compile_context = { |