From 5cc595cb2a057deff4c123425c9384f8e59e5e34 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Sat, 21 Dec 2019 01:21:52 +0900 Subject: Fix SEGV from numbered parameters outside of blocks; fix #4862 --- mrbgems/mruby-compiler/core/parse.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y index cf5f5230f..50bd01ba2 100644 --- a/mrbgems/mruby-compiler/core/parse.y +++ b/mrbgems/mruby-compiler/core/parse.y @@ -5952,7 +5952,7 @@ parser_yylex(parser_state *p) break; case '_': - if (toklen(p) == 2 && ISDIGIT(tok(p)[1])) { + if (toklen(p) == 2 && ISDIGIT(tok(p)[1]) && p->nvars) { int n = tok(p)[1] - '0'; node *nvars = p->nvars->car; -- cgit v1.2.3