diff options
| author | Kevin Newton <kddnewton@gmail.com> | 2024-08-26 10:07:30 -0400 |
|---|---|---|
| committer | Kevin Newton <kddnewton@gmail.com> | 2024-08-26 10:49:35 -0400 |
| commit | 4ede15fb53121419f7b00540cba73beae25b90a2 (patch) | |
| tree | f7a2c3226c9daabfd05229e145417ba089b4abb9 | |
| parent | 80d457b4b4357d3b6a44abd0ceb67e7657bc657a (diff) | |
[PRISM] Fix up nested string flags inside string concatenation
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11461
| -rw-r--r-- | prism/prism.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/prism/prism.c b/prism/prism.c index 0c6294d1a2..4d8a97b66e 100644 --- a/prism/prism.c +++ b/prism/prism.c @@ -5239,7 +5239,7 @@ pm_interpolated_string_node_append(pm_interpolated_string_node_t *node, pm_node_ switch (PM_NODE_TYPE(part)) { case PM_STRING_NODE: - pm_node_flag_set(part, PM_NODE_FLAG_STATIC_LITERAL | PM_STRING_FLAGS_FROZEN); + part->flags = (pm_node_flags_t) ((part->flags | PM_NODE_FLAG_STATIC_LITERAL | PM_STRING_FLAGS_FROZEN) & ~PM_STRING_FLAGS_MUTABLE); break; case PM_INTERPOLATED_STRING_NODE: if (PM_NODE_FLAG_P(part, PM_NODE_FLAG_STATIC_LITERAL)) { @@ -5263,7 +5263,7 @@ pm_interpolated_string_node_append(pm_interpolated_string_node_t *node, pm_node_ // If the embedded statement is a string, then we can make that // string as frozen and static literal, and not touch the static // literal status of this string. - pm_node_flag_set(embedded, PM_NODE_FLAG_STATIC_LITERAL | PM_STRING_FLAGS_FROZEN); + embedded->flags = (pm_node_flags_t) ((embedded->flags | PM_NODE_FLAG_STATIC_LITERAL | PM_STRING_FLAGS_FROZEN) & ~PM_STRING_FLAGS_MUTABLE); if (PM_NODE_FLAG_P(node, PM_NODE_FLAG_STATIC_LITERAL)) { MUTABLE_FLAGS(node); |
