diff options
| author | Kevin Newton <kddnewton@gmail.com> | 2024-01-22 11:55:50 -0500 |
|---|---|---|
| committer | Kevin Newton <kddnewton@gmail.com> | 2024-01-22 12:54:32 -0500 |
| commit | e5f8585a2999bff59e8b79605db7868bf702f84b (patch) | |
| tree | bef24645a6ae74b43e11801bfa8f86bb64b505c4 | |
| parent | 4fc0a901ac683eaebc39db1948f8f0db6d8bd19f (diff) | |
[PRISM] Fix line for leave instructions
| -rw-r--r-- | prism_compile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/prism_compile.c b/prism_compile.c index 6ae9e094b2..8f86b92975 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -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; |
