diff options
author | Kevin Newton <kddnewton@gmail.com> | 2024-01-29 16:39:46 -0500 |
---|---|---|
committer | Kevin Newton <kddnewton@gmail.com> | 2024-01-29 22:22:30 -0500 |
commit | 83966a57fe6a271e64fb2629e7bbb8f0c34948a2 (patch) | |
tree | 7c3741ed705e9d7da314b71b0bfc65db4b52a267 | |
parent | db5d9429a0d30213915fa36f2c6641065d01854a (diff) |
[PRISM] Method location for calls
-rw-r--r-- | prism_compile.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/prism_compile.c b/prism_compile.c index baab1a55fc..46ce25e485 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -2697,8 +2697,13 @@ pm_compile_call(rb_iseq_t *iseq, const pm_call_node_t *call_node, LINK_ANCHOR *c { pm_parser_t *parser = scope_node->parser; pm_newline_list_t newline_list = parser->newline_list; - int lineno = (int)pm_newline_list_line_column(&newline_list, ((pm_node_t *)call_node)->location.start).line; + + const uint8_t *call_start = call_node->message_loc.start; + if (call_start == NULL) call_start = call_node->base.location.start; + + int lineno = (int) pm_newline_list_line_column(&newline_list, call_start).line; NODE dummy_line_node = generate_dummy_line_node(lineno, lineno); + LABEL *else_label = NEW_LABEL(lineno); LABEL *end_label = NEW_LABEL(lineno); |