Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -5565,7 +5565,7 @@ compile_hash(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, int meth
return 1;
}

VALUE
static VALUE
rb_node_case_when_optimizable_literal(const NODE *const node)
{
switch (nd_type(node)) {
Expand Down
12 changes: 12 additions & 0 deletions prism/prism.c
Original file line number Diff line number Diff line change
Expand Up @@ -19816,6 +19816,18 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, u
}
}

/* If a missing terminator left this heredoc's lex mode on the
* stack, it still points at our stack-local common_whitespace.
* Clear the pointer so that subsequent lexing cannot read from
* this function's dead stack frame. */
pm_lex_mode_t *whitespace_mode = parser->lex_modes.current;
do {
if (whitespace_mode->mode == PM_LEX_HEREDOC && whitespace_mode->as.heredoc.common_whitespace == &common_whitespace) {
whitespace_mode->as.heredoc.common_whitespace = NULL;
}
whitespace_mode = whitespace_mode->prev;
} while (whitespace_mode != NULL);

if (match1(parser, PM_TOKEN_STRING_BEGIN)) {
return parse_strings(parser, node, false, (uint16_t) (depth + 1));
}
Expand Down