summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2015-05-20 19:12:31 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2015-05-20 19:14:04 +0900
commitb7049b3945862c7fae803c287d981b33268e955b (patch)
tree74568cb3b743acebf2cab2f1322a03bfd67f6a13 /src
parentbce38434564c559739f1f431c3725474eb610add (diff)
downloadmruby-b7049b3945862c7fae803c287d981b33268e955b.tar.gz
mruby-b7049b3945862c7fae803c287d981b33268e955b.zip
there may be expecting here-doc when we see terminating characters; fix #2780
Diffstat (limited to 'src')
-rw-r--r--src/codegen.c1
-rw-r--r--src/parse.y3
2 files changed, 2 insertions, 2 deletions
diff --git a/src/codegen.c b/src/codegen.c
index 16e1235de..27369361f 100644
--- a/src/codegen.c
+++ b/src/codegen.c
@@ -2108,6 +2108,7 @@ codegen(codegen_scope *s, node *tree, int val)
if (val) {
node *n = tree;
+ if (!n) break;
codegen(s, n->car, VAL);
n = n->cdr;
while (n) {
diff --git a/src/parse.y b/src/parse.y
index 7e313132b..55ad602ba 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -4116,10 +4116,9 @@ parser_yylex(parser_state *p)
retry:
last_state = p->lstate;
switch (c = nextc(p)) {
- case '\0': /* NUL */
case '\004': /* ^D */
case '\032': /* ^Z */
- return 0;
+ case '\0': /* NUL */
case -1: /* end of script. */
if (p->heredocs_from_nextline)
goto maybe_heredoc;