diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-12-21 01:21:52 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-12-21 01:24:56 +0900 |
| commit | 5cc595cb2a057deff4c123425c9384f8e59e5e34 (patch) | |
| tree | 9dabf9d9fb42c32b5fcda4a538016c289d2f660e | |
| parent | ef8621cb6145cda0a1c72273f59c1192450affcf (diff) | |
| download | mruby-5cc595cb2a057deff4c123425c9384f8e59e5e34.tar.gz mruby-5cc595cb2a057deff4c123425c9384f8e59e5e34.zip | |
Fix SEGV from numbered parameters outside of blocks; fix #4862
| -rw-r--r-- | mrbgems/mruby-compiler/core/parse.y | 2 |
1 files changed, 1 insertions, 1 deletions
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; |
