|
60 | 60 | #define PM_SPECIAL_CONSTANT_FLAG ((pm_constant_id_t)(1 << 31))
|
61 | 61 | #define PM_CONSTANT_AND ((pm_constant_id_t)(idAnd | PM_SPECIAL_CONSTANT_FLAG))
|
62 | 62 | #define PM_CONSTANT_MULT ((pm_constant_id_t)(idMULT | PM_SPECIAL_CONSTANT_FLAG))
|
| 63 | +#define PM_CONSTANT_POW ((pm_constant_id_t)(idPow | PM_SPECIAL_CONSTANT_FLAG)) |
63 | 64 |
|
64 | 65 | rb_iseq_t *
|
65 | 66 | pm_iseq_new_with_opt(pm_scope_node_t *scope_node, pm_parser_t *parser, VALUE name, VALUE path, VALUE realpath,
|
@@ -1025,7 +1026,13 @@ pm_arg_compile_keyword_hash_node(pm_keyword_hash_node_t *node, rb_iseq_t *iseq,
|
1025 | 1026 | }
|
1026 | 1027 |
|
1027 | 1028 | pm_assoc_splat_node_t *assoc_splat = (pm_assoc_splat_node_t *)cur_node;
|
1028 |
| - PM_COMPILE(assoc_splat->value); |
| 1029 | + if (assoc_splat->value != NULL) { |
| 1030 | + PM_COMPILE(assoc_splat->value); |
| 1031 | + } |
| 1032 | + else { |
| 1033 | + pm_local_index_t index = pm_lookup_local_index(iseq, scope_node, PM_CONSTANT_POW, 0); |
| 1034 | + ADD_GETLOCAL(ret, &dummy_line_node, index.index, index.level); |
| 1035 | + } |
1029 | 1036 |
|
1030 | 1037 | if (len > 1) {
|
1031 | 1038 | ADD_SEND(ret, &dummy_line_node, id_core_hash_merge_kwd, INT2FIX(2));
|
@@ -6589,7 +6596,8 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret,
|
6589 | 6596 | pm_insert_local_index(constant_id, local_index, index_lookup_table, local_table_for_iseq, scope_node);
|
6590 | 6597 | }
|
6591 | 6598 | else {
|
6592 |
| - local_table_for_iseq->ids[local_index] = idPow; |
| 6599 | + local_table_for_iseq->ids[local_index] = PM_CONSTANT_POW; |
| 6600 | + st_insert(index_lookup_table, PM_CONSTANT_POW, local_index); |
6593 | 6601 | }
|
6594 | 6602 | local_index++;
|
6595 | 6603 | break;
|
|
0 commit comments