summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-04-05 08:34:59 -0700
committerYukihiro "Matz" Matsumoto <[email protected]>2013-04-05 08:34:59 -0700
commitaf4eb8f9c234f0308846f6c98c127ebce8600117 (patch)
tree0aaadc2855b38b506b2e3028408e2a26124b3d14
parent97aee949c5931541b0d89963df6da1bcea4023c3 (diff)
parent51ef69dee6dd500991fa816b5b88a33a6f1e04e1 (diff)
downloadmruby-af4eb8f9c234f0308846f6c98c127ebce8600117.tar.gz
mruby-af4eb8f9c234f0308846f6c98c127ebce8600117.zip
Merge pull request #1138 from h2so5/syntax-error-for-incomplete-global-variable
Add syntax error for incomplete global variables
-rw-r--r--src/parse.y4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/parse.y b/src/parse.y
index 3b69601b1..35bc18cd5 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -4726,6 +4726,10 @@ parser_yylex(parser_state *p)
p->lstate = EXPR_END;
token_column = newtok(p);
c = nextc(p);
+ if (c == -1) {
+ yyerror(p, "incomplete global variable syntax");
+ return 0;
+ }
switch (c) {
case '_': /* $_: last read line string */
c = nextc(p);