From 1f6aeadc824ad597aa7ad8ab2ddb554f448147ac Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 11 Jul 2024 13:05:14 -0400 Subject: [PATCH] [PRISM] Fix Windows 2015 segfault --- prism_compile.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/prism_compile.c b/prism_compile.c index 0ea9de5d5f..45fede6178 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -4644,7 +4644,14 @@ pm_compile_ensure(rb_iseq_t *iseq, const pm_begin_node_t *cast, const pm_node_lo { const pm_parser_t *parser = scope_node->parser; const pm_statements_node_t *statements = cast->ensure_clause->statements; - const pm_node_location_t location = statements != NULL ? PM_NODE_START_LOCATION(parser, statements) : *node_location; + + pm_node_location_t location; + if (statements != NULL) { + location = PM_NODE_START_LOCATION(parser, statements); + } + else { + location = *node_location; + } LABEL *estart = NEW_LABEL(location.line); LABEL *eend = NEW_LABEL(location.line);