summaryrefslogtreecommitdiffhomepage
path: root/mrbgems
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2018-12-21 09:35:10 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2018-12-21 09:35:10 +0900
commit94b73b14402af26a844a98d22a87cce7d8f58ea0 (patch)
tree74f00205a057ad16873a4477ea16b78385b26ba5 /mrbgems
parented2bc5d4ed363f8d8d1f4bee69555972cfbed262 (diff)
downloadmruby-94b73b14402af26a844a98d22a87cce7d8f58ea0.tar.gz
mruby-94b73b14402af26a844a98d22a87cce7d8f58ea0.zip
Add `NULL` pointer check before `void_expr_error()`; fix #4192
Diffstat (limited to 'mrbgems')
-rw-r--r--mrbgems/mruby-compiler/core/parse.y6
1 files changed, 4 insertions, 2 deletions
diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y
index d143344c3..0e67e5881 100644
--- a/mrbgems/mruby-compiler/core/parse.y
+++ b/mrbgems/mruby-compiler/core/parse.y
@@ -3664,8 +3664,10 @@ void_expr_error(parser_state *p, node *n)
break;
case NODE_AND:
case NODE_OR:
- void_expr_error(p, n->cdr->car);
- void_expr_error(p, n->cdr->cdr);
+ if (n->cdr) {
+ void_expr_error(p, n->cdr->car);
+ void_expr_error(p, n->cdr->cdr);
+ }
break;
case NODE_BEGIN:
if (n->cdr) {