diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-11-16 18:18:23 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-11-17 09:18:02 -0800 |
commit | f45b078d20e995d83ee8428c8f199c0e6eca92f9 (patch) | |
tree | c476f930761d33da5ed9c9217afd196d394c7e10 /embed.fnc | |
parent | 3973654ea25ef9a4fe80b488debf904c3291a92d (diff) | |
download | perl-f45b078d20e995d83ee8428c8f199c0e6eca92f9.tar.gz |
[perl #70151] eval localises %^H at runtime
It doesn’t any more.
Now the hints are localised in a separate inner scope surrounding the
call to yyparse. This meant moving hint-handling code from pp_require
and pp_entereval into S_doeval.
Some tests in t/comp/hints.t were testing for the buggy behaviour, so
they have been adjusted.
Basically, this fixes
sub import {
eval "strict->import"
}
which should work the same way as
sub import {
strict->import
}
but was not working because %^H and $^H were being localised to
the eval at its run time, not just its compilation. So the values
assigned to %^H and $^H at the eval’s run time would simply be lost.
Diffstat (limited to 'embed.fnc')
-rw-r--r-- | embed.fnc | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1797,7 +1797,8 @@ sR |I32 |dopoptoloop |I32 startingblock sR |I32 |dopoptosub_at |NN const PERL_CONTEXT* cxstk|I32 startingblock sR |I32 |dopoptowhen |I32 startingblock s |void |save_lines |NULLOK AV *array|NN SV *sv -s |bool |doeval |int gimme|NULLOK OP** startop|NULLOK CV* outside|U32 seq +s |bool |doeval |int gimme|NULLOK OP** startop \ + |NULLOK CV* outside|U32 seq|NULLOK HV* hh sR |PerlIO *|check_type_and_open|NN SV *name #ifndef PERL_DISABLE_PMC sR |PerlIO *|doopen_pm |NN SV *name |