summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2024-07-11 13:05:14 -0400
committerKevin Newton <kddnewton@gmail.com>2024-07-11 14:25:54 -0400
commit1f6aeadc824ad597aa7ad8ab2ddb554f448147ac (patch)
treedc09159309fd3a64d699119e2254bcc35a1098c7
parentac093f5a06aa3ab2280c7914888f22332cca8400 (diff)
[PRISM] Fix Windows 2015 segfault
-rw-r--r--prism_compile.c9
1 files changed, 8 insertions, 1 deletions
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);