diff options
author | Peter Martini <PeterCMartini@GMail.com> | 2013-03-03 00:09:58 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2013-03-03 00:25:13 +0000 |
commit | 89e006ae4e39db68ad35c878eb6e6de83ebd8ec9 (patch) | |
tree | 0b1dd9aff102daa5cbff60b5fad1d8a0ab848bdd /toke.c | |
parent | a429ddf7a2c14de7caaf9248c6a79212167468f9 (diff) | |
download | perl-89e006ae4e39db68ad35c878eb6e6de83ebd8ec9.tar.gz |
Stop SEGV on 'our sub { syntax error }'
Fix for RT #116981. If a sub is declared with our, the name is added
to the stash early, and left with a NULL ptr if there's a syntax error
while compiling it.
Since the only time it becomes an issue is when that same name
is used in the same scope after a syntax error, what happens in
the pad is not particularly important. The simple fix is to
simply fall back to treating it like a bareword, and pretending
it was never added to the pad in the first place.
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -6900,6 +6900,11 @@ Perl_yylex(pTHX) gv = gv_fetchsv(sv, GV_NOADD_NOINIT | SvUTF8(sv), SVt_PVCV); off = 0; + if (!gv) { + sv_free(sv); + sv = NULL; + goto just_a_word; + } } else { rv2cv_op = newOP(OP_PADANY, 0); |