зеркало из https://github.com/github/ruby.git
[PRISM] Fix line for leave instructions
This commit is contained in:
Родитель
4fc0a901ac
Коммит
e5f8585a29
|
@ -3358,8 +3358,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret,
|
|||
int lineno = (int)pm_newline_list_line_column(&newline_list, node->location.start).line;
|
||||
NODE dummy_line_node = generate_dummy_line_node(lineno, lineno);
|
||||
|
||||
if (node->flags & PM_NODE_FLAG_NEWLINE &&
|
||||
ISEQ_COMPILE_DATA(iseq)->last_line != lineno) {
|
||||
if (node->flags & PM_NODE_FLAG_NEWLINE && ISEQ_COMPILE_DATA(iseq)->last_line != lineno) {
|
||||
int event = RUBY_EVENT_LINE;
|
||||
|
||||
ISEQ_COMPILE_DATA(iseq)->last_line = lineno;
|
||||
|
@ -6917,6 +6916,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret,
|
|||
}
|
||||
|
||||
if (!PM_NODE_TYPE_P(scope_node->ast_node, PM_ENSURE_NODE)) {
|
||||
NODE dummy_line_node = generate_dummy_line_node(ISEQ_COMPILE_DATA(iseq)->last_line, -1);
|
||||
ADD_INSN(ret, &dummy_line_node, leave);
|
||||
}
|
||||
return;
|
||||
|
|
Загрузка…
Ссылка в новой задаче