diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-04-01 21:17:46 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-04-01 21:17:46 +0000 |
commit | 5b9c067131ee63b4afa00d1d71c771377deb6ff9 (patch) | |
tree | f0d23e7597d8b97766a275feb1effc1c8360e3bb /mg.c | |
parent | def9038f0e6b68e6331316ef6cd457a2bf75dab6 (diff) | |
download | perl-5b9c067131ee63b4afa00d1d71c771377deb6ff9.tar.gz |
Automatically set HINT_LOCALIZE_HH whenever %^H is modified.
p4raw-id: //depot/perl@27666
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -2857,6 +2857,10 @@ Perl_magic_sethint(pTHX_ SV *sv, MAGIC *mg) it's NULL. If needed for threads, the alternative could lock a mutex, or take other more complex action. */ + /* Something changed in %^H, so it will need to be restored on scope exit. + Doing this here saves a lot of doing it manually in perl code (and + forgetting to do it, and consequent subtle errors. */ + PL_hints |= HINT_LOCALIZE_HH; PL_compiling.cop_hints = Perl_refcounted_he_new(aTHX_ PL_compiling.cop_hints, (SV *)mg->mg_ptr, newSVsv(sv)); @@ -2876,6 +2880,7 @@ Perl_magic_clearhint(pTHX_ SV *sv, MAGIC *mg) dVAR; assert(mg->mg_len == HEf_SVKEY); + PL_hints |= HINT_LOCALIZE_HH; PL_compiling.cop_hints = Perl_refcounted_he_new(aTHX_ PL_compiling.cop_hints, (SV *)mg->mg_ptr, &PL_sv_placeholder); |