summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2016-01-12 15:39:00 +1100
committerTony Cook <tony@develop-help.com>2016-01-14 09:41:55 +1100
commit61d30259f32e5bba52238d60608b6909208eb604 (patch)
treeed5479e2fd2470bd4d413e5d4b1bd9d029035404 /toke.c
parenta64a174832c0301f4b239cab7e2ab4bb644060fb (diff)
downloadperl-61d30259f32e5bba52238d60608b6909208eb604.tar.gz
[perl #123737] handle a non-identifer after @ better for a missing op
Previously this would assert().
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/toke.c b/toke.c
index 95ce3fd496..23c3521c91 100644
--- a/toke.c
+++ b/toke.c
@@ -6368,8 +6368,14 @@ Perl_yylex(pTHX)
POSTDEREF('@');
PL_tokenbuf[0] = '@';
s = scan_ident(s, PL_tokenbuf + 1, sizeof PL_tokenbuf - 1, FALSE);
- if (PL_expect == XOPERATOR)
- no_op("Array", s);
+ if (PL_expect == XOPERATOR) {
+ d = s;
+ if (PL_bufptr > s) {
+ d = PL_bufptr-1;
+ PL_bufptr = PL_oldbufptr;
+ }
+ no_op("Array", d);
+ }
pl_yylval.ival = 0;
if (!PL_tokenbuf[1]) {
PREREF('@');