diff --git a/prism_compile.c b/prism_compile.c index 11c558de9b..20be456cad 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -7771,33 +7771,29 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret, return; } case PM_SOURCE_ENCODING_NODE: { - // Source encoding nodes are generated by the __ENCODING__ syntax. They - // reference the encoding object corresponding to the encoding of the - // source file, and can be changed by a magic encoding comment. + // __ENCODING__ + // ^^^^^^^^^^^^ if (!popped) { VALUE value = pm_static_literal_value(node, scope_node); - ADD_INSN1(ret, &dummy_line_node, putobject, value); - RB_OBJ_WRITTEN(iseq, Qundef, value); + PUSH_INSN1(ret, location, putobject, value); } return; } case PM_SOURCE_FILE_NODE: { - // Source file nodes are generated by the __FILE__ syntax. They - // reference the file name of the source file. + // __FILE__ + // ^^^^^^^^ if (!popped) { VALUE value = pm_static_literal_value(node, scope_node); - ADD_INSN1(ret, &dummy_line_node, putstring, value); - RB_OBJ_WRITTEN(iseq, Qundef, value); + PUSH_INSN1(ret, location, putstring, value); } return; } case PM_SOURCE_LINE_NODE: { - // Source line nodes are generated by the __LINE__ syntax. They - // reference the line number where they occur in the source file. + // __LINE__ + // ^^^^^^^^ if (!popped) { VALUE value = pm_static_literal_value(node, scope_node); - ADD_INSN1(ret, &dummy_line_node, putobject, value); - RB_OBJ_WRITTEN(iseq, Qundef, value); + PUSH_INSN1(ret, location, putobject, value); } return; }