summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-01-24 07:09:05 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-01-24 07:09:05 +0000
commit1875ffd79b5d40eef9919d3285c217ef3635e812 (patch)
treee3d8290ac66596412b09d9caf0e1eba1edb41e05 /toke.c
parentee4d903cc41711efc019efd25339b39970bad65c (diff)
parentea95c1407851ede0a28b53a77da0cb2fc072454d (diff)
downloadperl-1875ffd79b5d40eef9919d3285c217ef3635e812.tar.gz
integrate cfgperl changes into mainline
p4raw-id: //depot/perl@2695
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/toke.c b/toke.c
index fca117b047..de6bfda949 100644
--- a/toke.c
+++ b/toke.c
@@ -822,10 +822,15 @@ sublex_done(void)
if (SvCOMPILED(PL_lex_repl)) {
PL_lex_state = LEX_INTERPNORMAL;
PL_lex_starts++;
+ /* we don't clear PL_lex_repl here, so that we can check later
+ whether this is an evalled subst; that means we rely on the
+ logic to ensure sublex_done() is called again only via the
+ branch (in yylex()) that clears PL_lex_repl, else we'll loop */
}
- else
+ else {
PL_lex_state = LEX_INTERPCONCAT;
- PL_lex_repl = Nullsv;
+ PL_lex_repl = Nullsv;
+ }
return ',';
}
else {
@@ -1845,6 +1850,11 @@ int yylex(PERL_YYLEX_PARAM_DECL)
PL_lex_state = LEX_INTERPCONCAT;
return ')';
}
+ if (PL_lex_inwhat == OP_SUBST && PL_lex_repl && SvCOMPILED(PL_lex_repl)) {
+ if (PL_bufptr != PL_bufend)
+ croak("Bad evalled substitution pattern");
+ PL_lex_repl = Nullsv;
+ }
/* FALLTHROUGH */
case LEX_INTERPCONCAT:
#ifdef DEBUGGING