diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-09-23 01:38:10 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-09-23 01:38:10 -0700 |
commit | 5a9a79a4cd93fcfb7398dd4e99030923446e8b08 (patch) | |
tree | dc2e12537b1b63f77e60b3f19dfbdb3a39e0b2c4 /gv.c | |
parent | a5763045776ca8ceaf2c78fa074b0f8a1dbe6e9e (diff) | |
download | perl-5a9a79a4cd93fcfb7398dd4e99030923446e8b08.tar.gz |
[perl #71806] perldb does not setup %dbline with the shebang option -d
The first time gv_fetchfile is called for a particular file, it
creates the glob and, if debugging is on, creates an AV. If the glob
already exists (i.e., in subsequent calls), the AV is not created. The
attached patch moves the check for debugging mode and the creation of
the AV outside the if-block that checks whether the glob exists.
This bug seems to have existed for a very long time and has been
intermittent. It seems that many different things can change the order
in which #!perl -d and gv_fetchfile occur. Whether compilation options
affect it I do not know. I can reproduce it in 5.6.2, 5.8.[123456]
(non-threaded) and 5.11.3 (both threaded and non-threaded), but not
5.8.[789] or 5.10.[01] (threaded).
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -121,9 +121,9 @@ Perl_gv_fetchfile_flags(pTHX_ const char *const name, const STRLEN namelen, #else sv_setpvn(GvSV(gv), name, namelen); #endif - if (PERLDB_LINE || PERLDB_SAVESRC) - hv_magic(GvHVn(gv_AVadd(gv)), NULL, PERL_MAGIC_dbfile); } + if ((PERLDB_LINE || PERLDB_SAVESRC) && !GvAV(gv)) + hv_magic(GvHVn(gv_AVadd(gv)), NULL, PERL_MAGIC_dbfile); if (tmpbuf != smallbuf) Safefree(tmpbuf); return gv; |