diff options
author | Haldun Bayhantopcu <[email protected]> | 2023-09-25 15:20:56 +0200 |
---|---|---|
committer | git <[email protected]> | 2023-09-25 13:53:34 +0000 |
commit | acd44902b917230066b4fc7ea6c7e12556274512 (patch) | |
tree | 3f0920aedae383545187714de048e7e820d87ad5 | |
parent | 0e808183eea91b610a17a941e4592b494e445203 (diff) |
[ruby/yarp] Fix crashes in parsing block arguments
https://github.com/ruby/yarp/commit/e1f2fde775
-rw-r--r-- | yarp/yarp.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/yarp/yarp.c b/yarp/yarp.c index fe291d0c3b..3272d15d85 100644 --- a/yarp/yarp.c +++ b/yarp/yarp.c @@ -9810,6 +9810,9 @@ parse_arguments_list(yp_parser_t *parser, yp_arguments_t *arguments, bool accept arguments->block = (yp_node_t *) block; } else { yp_diagnostic_list_append(&parser->error_list, block->base.location.start, block->base.location.end, YP_ERR_ARGUMENT_BLOCK_MULTI); + if (arguments->arguments == NULL) { + arguments->arguments = yp_arguments_node_create(parser); + } yp_arguments_node_arguments_append(arguments->arguments, arguments->block); arguments->block = (yp_node_t *) block; } |