| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
| |
The existence of main::main::... caused mro_package_moved to break
Text::Template, and probably Acme::Meta as well.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes the problem of isa cache linearisations’ and method caches’
not being reset on nonexistent packages when they are replaced with
real packages as a result of parent stashes’ being moved. This can
happen in cases like this:
@left::ISA = 'outer::inner';
@right::ISA = 'clone::inner';
{package outer::inner}
*clone:: = \%outer::;
print "ok 1", "\n" if left->isa("clone::inner");
print "ok 2", "\n" if right->isa("outer::inner");
This changes mro_package_moved’s parameter list as documented in the
diff for mro.c. See also the new comments in that function.
|
| |
|
|
|
|
|
|
|
|
| |
This makes string-to-glob assignment and hashref-to-glob assignment
reset isa caches by calling mro_package_moved, if the glob’s name
ends with ::.
Related to [perl #75176].
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This only applies to glob-to-glob assignments and deletions of stash
elements. Other types of stash manipulation are dealt with by subse-
quent patches.
It adds mro_package_moved, a private function that iterates through
subpackages, calling mro_isa_changed_in on each.
This is related to [perl #75176], but is not the same bug. It simply
got in the way of fixing [perl #75176].
|
|
|
|
|
| |
Let ExtUtils::MakeMaker deal with running these extraction scripts, rather than
repeating the logic in (at least) 5 places.
|
|
|
|
|
| |
Let ExtUtils::MakeMaker deal with running these extraction scripts, rather than
repeating the logic in (at least) 5 places.
|
|
|
|
|
| |
Let ExtUtils::MakeMaker deal with running these extraction scripts, rather than
repeating the logic in (at least) 5 places.
|
|
|
|
|
| |
This patch makes -0.0 stringify as "0" (while leaving sprintf %g/%f
unchanged).
|
|
|
|
|
| |
The & | ^ operators now avoid turning on numericness of read-only
arguments.
|
| |
|
|
|
|
|
| |
The attached patch adds the conversion if the value of the SV
looks_like_number.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The former behaviour of map and grep was to never free any temps.
Thus for large lists (and even worse, nested maps), the tmps stack could
grow very large. For all cases expect list-context map, the fix is easy:
just do a FREETMPS at the end of each iteration.
The list-context map however, needs to accumulate a list of temporaries
over the course of the iterations, and finally return that list to the
caller (which is responsible for freeing them). We get round this by, at
the end of each iteration, directly manipulating the tmps stack to free
everything *except* the values to be returned. To make this efficient,
we splice in the returned tmp items at the base of the stack frame, move
PL_tmps_floor above them, then do a FREETMPS (so they may appear twice on
the temps stack, but initially only get freed once).
|
|
|
|
|
| |
Add a test to ensure that S_refto returns a SVt_PVLV if the original
is a SVt_PVLV so that the lvalue-ness is preserved.
|
| |
|
|
|
|
|
|
|
|
| |
This reverts commit 92adfbd49af0758bcc9a198cf2df2bd78c4176b9, which
removed a necessary assignment for the sake of consting.
In doing so, it allows subroutine redefinition to work properly again
in the debugger.
|
| |
|
| |
|
|
|
|
| |
This reverts commit cffb36981555111f364a511fb5763f65ea748c0e.
|
|
|
|
|
|
|
|
| |
This patch restores the behavior of /\18/ to mean /\0018/, which was
inadvertently changed by c99e91e919b4bb89bab7829a9026ee01b1fff2a1.
This bug happens when t the first digit is [1-9], and the
second [89].
|
|
|
|
| |
Stop set-magic from being called after ref-to-glob assignment.
|
|
|
|
|
| |
We can't run regen.pl as part of the build, as we'd end up with a circular
dependency between the headers and miniperl.
|
|
|
|
|
|
|
| |
On systems that support fchdir, use it to clone dir handles.
On other systems, at least for now, don’t give the new thread a copy
of the handle. This is not ideal, but better than crashing.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
please find attached a patch against blead originating from [1] ,
that improves the "Layer does not match this perl" error message by
telling the user which IO layer failed and how. I've tested the
patch against a recent bleadperl and even without the modifications
to perldiag.t all tests pass. Still, for completeness, I've patched
perldiag.t as well.
The code is not mine, it was written and posted by Tye McQueen, I've
just tested it [2] and ferry the information. I'm aware that this
patch is too late for 5.12 , but in the sense of improving Perl in
the long run, I hope the change still makes it into a version of
Perl.
-max
[1] http://perlmonks.org/?node_id=829815
[2] Certified Works On My Machine, 2010
|
|
|
|
|
|
| |
parse_unicode_opts expects to end on '\0'. So #!perl -C -w causes an
‘Unknown Unicode option letter ' '’ error. The attached
patch fixes it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This test from t/op/gv.t was added by change 22315/4ce457a6:
{
# test the assignment of a GLOB to an LVALUE
my $e = '';
local $SIG{__DIE__} = sub { $e = $_[0] };
my $v;
sub f { $_[0] = 0; $_[0] = "a"; $_[0] = *DATA }
f($v);
is ($v, '*main::DATA');
my $x = <$v>;
is ($x, "perl\n");
}
That change was the one that made glob-to-lvalue assignment work to
begin with. But this test passes in perl version *prior* to that
change.
This patch fixes the test and adds tests to make sure what is assigned
is actually a glob, and not just a string.
It also happens to fix the stringification bug. In doing so, it essen-
tially ‘enables’ globs-as-PVLVs.
It turns out that many different parts of the perl source don’t fully
take this into account, so this patch also fixes the following to work
with them (I tried to make these into separate patches, but they are
so intertwined it just got too complicated):
• GvIO(gv) to make readline and other I/O ops work.
• Autovivification of glob slots.
• tie *$pvlv
• *$pvlv = undef, *$pvlv = $number, *$pvlv = $ref
• Duplicating a filehandle accessed through a PVLV glob when the
stringified form of the glob cannot be used to access the file
handle (!)
• Using a PVLV glob as a subroutine reference
• Coderef assignment when the glob is no longer in the symbol table
• open with a PVLV glob for the filehandle
• -t and -T
• Unopened file handle warnings
|
| |
|
|
|
|
|
| |
This patch stops y from calling get-magic twice. (This has caused
double magick since as far back as 5.6.2.)
|
|
|
|
|
|
| |
This fixes m and s. It modifies pp_regcomp to avoid extra magic. It
also corrects a bug in sv_catsv_flags, which would still call
mg_get(ssv) even without the SV_GMAGIC flag set.
|
|
|
|
|
|
| |
This fixes ! by changing sv_2bool to sv_2bool_flags (with a macro
wrapper) and adding SvTRUE_nomg. It also corrects the docs that state
incorrectly that SvTRUE does not handle magic.
|
|
|
|
|
|
| |
This patch changes sv_eq, sv_cmp, sv_cmp_locale and sv_collxfrm
to _flags forms, with macros under the old names for sv_eq and
sv_collxfrm, but functions for sv_cmp* since pp_sort.c needs them.
|
|
|
|
|
|
| |
Fix all the tests that were using quotes, and (by implication) working
because barewords are treated as strings, and one-liners aren't run under
strict.
|
|
|
|
|
| |
test.pl uses "" for command line quoting on Win32, VMS and NetWare, '' on *nix.
Hence what "works on my machine" on *nix may not work elsewhere.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This case can be reduced to:
eval "UNITCHECK{ eval 0 }"
(eval 0 triggers the bug more reliably than eval ''.)
The inner eval clobbers PL_eval_start, so when the UNITCHECK finishes,
the outer eval tries to call the inner eval’s code, which has been
freed already.
This commit saves PL_eval_start and restores it after UNITCHECK.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds recognition of these modifiers, with appropriate action
for d and l. u does nothing useful yet. This allows for the
interpolation of a regex into another one without losing the character
set semantics that it was compiled with, as for the first time, the
semantics is now specified in the stringification as one of these
modifiers.
To this end, it allocates an unused bit in the structures. The off-
sets change so as to not disturb other bits.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
t/base/rs.t needs to @INClude the lib directory before requiring
PerlIO::scalar, even if the require is in an eval, because it will
otherwise pick up a previously-installed copy.
Since 87b9e1600 (Eliminate PL_* accessor functions under ithreads), a
binary-incompatible change, I’ve been getting these errors:
t/base/rs......................................................dyld: lazy symbol binding failed: Symbol not found: _Perl_Istack_sp_ptr
Referenced from: /usr/local/lib/perl5/5.13.5/darwin-thread-multi-2level/auto/PerlIO/scalar/scalar.bundle
Expected in: dynamic lookup
dyld: Symbol not found: _Perl_Istack_sp_ptr
Referenced from: /usr/local/lib/perl5/5.13.5/darwin-thread-multi-2level/auto/PerlIO/scalar/scalar.bundle
Expected in: dynamic lookup
FAILED--no leader found
Failed a basic test (base/rs.t) -- cannot continue.
make: *** [test] Error 255
|
|
|
|
|
|
|
|
|
|
|
|
| |
$text =~ ( 1 ? /phoo/ : /bear/)
used to be constant-folded to
$text =~ /phoo/
This patch solves the problem by marking match and subst ops as
OPf_SPECIAL during constant folding, so the =~ operator can tell not
to take possession of it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
$ perl -le '$_="CCCGGG"; s!.!@a{print("[$&]"),/./}!g'
[C]
[C]
[C]
[C]
[C]
[C]
What’s happening is that the s/// does not reset PL_curpm for each
iteration, because it doesn’t usually have to.
The RHS’s scoping takes care of it most of the time. This happens with
the /e modifier and with @{...}.
In this example, though, we have a subscript, not a block. This sub-
script is in the same scope as the s/// itself.
The assumption that the substitution operator will never have to reset
PL_curpm itself appears to be incorrect. This fixes it.
|
| |
|
|
|
|
|
| |
Reset cx in pp_sort before POPSUB, as the pointer may no
longer be valid.
|
|
|
|
|
|
|
|
| |
This test was producing spurious output to stderr when not under
git control (e.g. a release tarball):
fatal: Not a git repository (or any parent up to mount parent )
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently perl does 3 major scans of the SV arenas, so the action of
perl_destroy() is a bit like this:
for (all arena SVs) {
if (its a ref to an object)
undef the ref (and thus probably free the object)
}
for (all arena SVs) {
if (it's a typeglob and at least one of its slots holds an object) {
set SVf_BREAK on the gv
SvREFCNT_dec(gv)
}
}
return if $PERL_DESTRUCT_LEVEL < 1;
PL_in_clean_all = 1
for (all arena SVs) {
set SVf_BREAK on the sv
SvREFCNT_dec(sv)
}
The second scan is problematic, in that by randomly zapping GVs, it can
leave dangling pointers to freed GVs. This is while perl-level destructors
may still be called, meaning perl users can see corrupted state.
Note also that at this point PL_in_clean_all hasn't been set, so sv_free()
may put out 'Attempt to free unreferenced scalar' warnings.
This commit fixes this by only freeing the affected slots of the GV,
rather than freeing the GV itself. Thus makes it more like the first pass,
which undefs RVs, and ensures no dangling refs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds (?^...) to signify to use the default regex modifiers for the
cluster or embedded pattern-match modifier change. The major purpose of
this is to simplify regex stringification, so that "^" is output in
place of "-xism". As a result, the stringification will not change in
the future when new regex modifiers are added, so tests, etc. that rely
on a particular stringification will have to change now, but never
again.
Code that needs to work properly with both old- and new-style regexes
can use something like the following:
# Accept both old and new-style stringification
my $modifiers = (qr/foobar/ =~ /\Q(?^/) ? '^' : '-xism';
This construct is Ben Morrow's idea.
|
|
|
|
| |
We can now set PERL_CORE again when running its tests.
|
|
|
|
| |
These would fail when smokes tested under unicode locales.
|