Skip to content

Commit 83966a5

Browse files
committed
[PRISM] Method location for calls
1 parent db5d942 commit 83966a5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: prism_compile.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -2697,8 +2697,13 @@ pm_compile_call(rb_iseq_t *iseq, const pm_call_node_t *call_node, LINK_ANCHOR *c
26972697
{
26982698
pm_parser_t *parser = scope_node->parser;
26992699
pm_newline_list_t newline_list = parser->newline_list;
2700-
int lineno = (int)pm_newline_list_line_column(&newline_list, ((pm_node_t *)call_node)->location.start).line;
2700+
2701+
const uint8_t *call_start = call_node->message_loc.start;
2702+
if (call_start == NULL) call_start = call_node->base.location.start;
2703+
2704+
int lineno = (int) pm_newline_list_line_column(&newline_list, call_start).line;
27012705
NODE dummy_line_node = generate_dummy_line_node(lineno, lineno);
2706+
27022707
LABEL *else_label = NEW_LABEL(lineno);
27032708
LABEL *end_label = NEW_LABEL(lineno);
27042709

0 commit comments

Comments
 (0)