summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authorKevin Newton <[email protected]>2024-02-06 11:59:49 -0500
committerKevin Newton <[email protected]>2024-02-06 12:36:46 -0500
commitccec209b2cced2ddb8463c4933ef729a44d0363c (patch)
treec141003ad30ea544802b1e2031b4fa81d9fd451b /iseq.c
parentd77172b79b1cd28bc38a75162e41d2c8b6e71088 (diff)
[PRISM] Fix fsl coming from file
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/iseq.c b/iseq.c
index e2e9b4d6e7..440270bd29 100644
--- a/iseq.c
+++ b/iseq.c
@@ -1002,8 +1002,15 @@ pm_iseq_new_with_opt(pm_scope_node_t *node, VALUE name, VALUE path, VALUE realpa
.end_pos = { .lineno = (int) end.line, .column = (int) end.column }
};
+ rb_compile_option_t *current_option = (rb_compile_option_t *) option;
+ if (node->parser->frozen_string_literal) {
+ rb_compile_option_t new_option = *option;
+ new_option.frozen_string_literal = true;
+ current_option = &new_option;
+ }
+
prepare_iseq_build(iseq, name, path, realpath, first_lineno, &code_location, -1,
- parent, isolated_depth, type, Qnil, option);
+ parent, isolated_depth, type, Qnil, current_option);
pm_iseq_compile_node(iseq, node);
finish_iseq_build(iseq);