Skip to content

Commit

Permalink
[PRISM] Fix up source file when not frozen
Browse files Browse the repository at this point in the history
  • Loading branch information
kddnewton committed Mar 15, 2024
1 parent 043c90e commit b4f3f3c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions prism_compile.c
Expand Up @@ -7919,8 +7919,16 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret,
// __FILE__
// ^^^^^^^^
if (!popped) {
VALUE value = pm_static_literal_value(node, scope_node);
PUSH_INSN1(ret, location, putstring, value);
const pm_source_file_node_t *cast = (const pm_source_file_node_t *) node;
VALUE string = parse_string(scope_node, &cast->filepath);

if (PM_NODE_FLAG_P(cast, PM_STRING_FLAGS_FROZEN)) {
string = rb_fstring(string);

This comment has been minimized.

Copy link
@casperisfine

casperisfine Mar 15, 2024

Contributor

putstring should use a fstring too. But no worries I'm fixing it in #10263

PUSH_INSN1(ret, location, putobject, string);
}
else {
PUSH_INSN1(ret, location, putstring, string);
}
}
return;
}
Expand Down

0 comments on commit b4f3f3c

Please sign in to comment.