| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A pushmark doesn’t have to have a sibling:
$ ./perl -Ilib -MO=Concise -e '()[()]'
6 <@> leave[1 ref] vKP/REFC ->(end)
1 <0> enter ->2
2 <;> nextstate(main 1 -e:1) v:{ ->3
5 <2> lslice vK/2 ->6
- <1> ex-list lK ->4
3 <0> pushmark s ->4
- <0> stub lP ->-
- <1> ex-list lK ->5
4 <0> pushmark s ->5 <-- look here!
-e syntax OK
|
|
|
|
|
|
|
|
|
| |
Modified to stop Log::Agent from loading, that is.
There’s at least one CPAN module that does it. While that module
could be blamed, Storable used to be more robust in this area
before the AutoLoader extirpation, and there is nothing wrong with
robustness.
|
|
|
|
|
|
| |
It should be in the list of unary, not nullary, functions.
I’m surprised the tests passed on non-mad builds.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
I’m referring here to CVs, not C functions.
Actually, bsd_glob is the alias to doglob. doglob is no longer
called, as of commit 1bb8785ab1. So this commit is actually renaming
doglob to bsd_glob and removing the alias.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
The downgrade bug that constant.pm has to imitate is about to be fixed
in the next commit. The bug workaround is itself a bug if the bug it
is trying to work around is not present.
|
|
|
|
| |
No functional changes from 3.04_04, just a promotion to "stable".
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Tracking modules loaded by base.pm to avoid reloading them means
that any module that wishes to force a reload can't just modify
%INC but must also interact with base.pm to clear its cache.
Removing the module-loaded checks have minimal impact. The internal
call to require() is a NOP for a loaded module. For an internal
package, the require() will fail with the same error message as
before, which base.pm then ignores. Tracking modules loaded to avoid
this slight extra overhead is not worth the complexity for other
modules that wish to manipulate %INC.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, base.pm modified the $VERSION of modules it loaded to
the string "-1, set by base.pm". This is not a valid lax version
string and thus could not be parsed by version.pm. (It is also an
encapsulation violation, as it modifies a global in another package.)
This patch removes the $VERSION modification code entirely and uses
a private hash to track which modules base.pm has successfully loaded.
This also eliminates a subtle bug in how base.pm was checking for
the existence of a package's VERSION scalar.
[Though the final mechanism is different, thank you to John Peacock for
proposing the initial patch to eliminate the "-1..." code from base.pm]
|
| |
|
|
|
|
|
|
|
|
| |
986a805c added dist/IO/t/io_utf8argv.t which creates a utf-8 test file
from raw bytes. When PERL_UNICODE was set the bytes were encoded as
utf-8, so producing a double-encode file.
Create the file with :raw to avoid that.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
This patch makes perldoc with a URL use a somewhat reasonable name
based on the basename of the URL, instead of displaying PALLEGCSYO or
BJ1KKH1675 in the pod header (based on the tmp file name).
It treats all URLs the same (changing perldoc.pod to PERLDOC), instead
of treating .pm’s specially. Maybe this could be improved later.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
These modules currently warn when parsing ABSTRACT_FROM,
as the NAME section does not have the correct form; so
add "$package - " at the start of the NAME section line.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See <https://rt.cpan.org/Ticket/Display.html?id=66474>. Also, this
came up in <https://rt.perl.org/rt3/Ticket/Display.html?id=92728>.
The <> operator, when reading from the magic ARGV handle, automatic-
ally opens the next file. Layers set by the lexical open pragma are
applied, if they are in scope at the point where <> is used.
This works almost all the time, because the common convention is:
use open ":utf8";
while(<>) {
...
}
IO::Handle’s getline and getlines methods are Perl subroutines
that call <> themselves. But that happens within the scope of
IO/Handle.pm, so the caller’s I/O layer settings are ignored. That
means that these two expressions are not equivalent within in a
‘use open’ scope:
<>
*ARGV->getline
The latter will open the next file with no layers applied.
This commit solves that by putting PL_check hooks in place in
IO::Handle before compiling the getline and getlines subroutines.
Those hooks cause every state op (nextstate, or dbstate under the
debugger) to have a custom pp function that saves the previous value
of PL_curcop, calls the default pp function, and then restores
PL_curcop.
That means that getline and getlines run with the caller’s compile-
time hints. Another way to see it is that getline and getlines’s own
lexical hints are never activated.
(A state op carries all the lexical pragmata. Every statement
has one. When any op executes, it’s ‘pp’ function is called.
pp_nextstate and pp_dbstate both set PL_curcop to the op itself. Any
code that checks hints looks at PL_curcop, which contains the current
run-time hints.)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(This is the second bug reported in ticket #92436.)
Filter::Simple was using Text::Balanced’s extract_variable, which
...extracts any valid Perl variable or variable-
involved expression, including scalars, arrays, hashes, array
accesses, hash look-ups, method calls through objects, subrou-
tine calls through subroutine references, etc.
So it extracts things like $x->foo("blah lbah blah"). That means
that, when the user of Filter::Simple asks for everything except
strings, "blah lbah blah" is passed through anyway, because
Filter::Simple things it’s part of a variable name. That obviously
doesn’t work.
This commit makes Filter::Simple use a regular expression for varia-
bles, as it does for other things. It’s certainly not foolproof, but
Filter::Simple in general is not foolproof, and this regular expres-
sion is actually less foolproof than most parts of Filter::Simple. So
it’s a step in the right direction (unless you consider deletion to be
the right direction).
|
| |
|
| |
|
| |
|
|
|
|
| |
Longer term this should be added to ppport.h
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The test originally testing serialising and deserialising \&Test::ok. When
the test was converted from Test.pm to Test::More in 2009, it was changed to
use \&Test::More::ok. However, this turns out to be "works on my machine".
Test::More::ok from Test::Simple 0.61 onwards (2005, b1ddf16980125497) will
deserialise correctly. The previous implementation of Test::More::ok uses a
lexical from an outer scope. Hence the textual representation of the
subroutine (in isolation) fails to deserialise, because it's not valid under
strict, because there is no visible declaration of the lexical.
Hence switch to testing a large subroutine under our control, _store(), to
avoid unpleasant surprises from dependencies we were not even aware of.
The comment "large scalar" dates from the original test using \&Test::ok.
It's not clear which large scalar it refers to.
|
|
|
|
| |
The rest should probably be migrated to Devel::PPPort.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add XSLoader as a prerequisite.
Use parentheses for the call to XSLoader::load().
Don't pass parameters that old ExtUtil::MakeMaker doesn't understand.
Avoid the T_BOOL typemap, as xsubpp will always mortalise the SV generated
by processing RETVAL, T_BOOL generates the SV using boolSV() which returns
PL_sv_yes or PL_sv_no, and on 5.004 Perl_sv_2mortal() will croak if passed
a readonly scalar. This is actually a small optimisation on later perls, as
the call to Perl_sv_2mortal() isn't actually needed.
Avoid repeating the PPCODE by merging last_op_in_netorder() with
is_storing() and is_retrieving(). (Which I didn't spot was easy to do
when commit 7cb18e1b020cd2e5 merged is_storing() and is_retrieving().)
Together these reduce the size of the shared object by about 200 bytes on
this platform. Small, but in the right direction.
|
|
|
|
|
| |
ppport.h provides default definitions for PERL_UNUSED_DECL, dNOOP and dVAR,
so no need to duplicate this in Storable.xs
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Don't pass parameters that old ExtUtil::MakeMaker doesn't understand.
Ensure that $DynaLoader::dl_debug exists prior to calling into DynaLoader's
XS code.
|
|
|
|
|
|
| |
If ExtUtils::ParseXS emits conditional C pre-processor code once per XS file
to provide a default for dVAR, then it doesn't need to emit 4 lines per
function to cater for dVAR not being present.
|
|
|
|
|
|
|
|
|
|
| |
Filter::Simple’s $pod_or_DATA regexp was mistakenly written to look
for =end if the pod section began with =begin, and to look for the
end of the paragraph if the pod began with =for. Only =cut and EOF
can end pod.
This patch does not fix Filter::Simple’s naïve way of finding the
beginning of pod.
|
|
|
|
|
|
| |
$[ remains as a variable. It no longer has compile-time magic.
At runtime, it always reads as zero, accepts a write of zero, but dies
on writing any other value.
|
| |
|
| |
|
|
|
|
|
| |
In the previous commit, I added duplicate code to make it obvious what
was going on.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Jerry wrote:
> threads::shared objects stored inside other
> threads::shared structures are not properly destroyed.
> When a threads::shared object is 'removed' from a
> threads::shared structure (e.g., a hash), the object's
> DESTROY method is not called.
Later, he said:
> When PL_destroyhook and Perl_shared_object_destroy were
> added, the problem they were overcoming was that the
> destruction of each threads::shared proxy was causing the
> underlying shared object's DESTROY method to be called. The
> fix provided a refcount check on the shared object so that
> the DESTROY method was only called with the shared object
> was no longer in use.
>
> The above works fine when delete() and pop() are used,
> because a proxy is created for the stored shared object that
> is being deleted (i.e., the value returned by the delete()
> call), and when the proxy is destroyed, the object's DESTROY
> method is called.
>
> However, when the stored shared object is 'removed' in some
> other manner (e.g., setting the storage location to
> 'undef'), there is no proxy involved, and hence DESTROY does
> not get called for the object.
This commit fixes that by modifying sharedsv_scalar_store,
sharedsv_scalar_mg_free and sharedsv_array_mg_CLEAR.
Each of those functions now checks whether the current item being
freed has sub-items with reference counts of 1. If so, that means the
sub-item will be freed as a result of the outer SV’s being freed. It
also means that there are no proxy objects and that destructors will
hence not be called. So it pushes a new proxy on to the calling con-
text’s mortals stack. If there are multiple levels of nested objects,
then, when the proxy on the mortals stack is freed, it triggers
sharedsv_scalar_mg_free, which goes through the process again.
This does not fix the problem for shared objects that still exist
(without proxies) at global destruction time. I cannot make that
work, as circularities will cause new proxies to be created continu-
ously and pushed on to the mortals stack. Also, the proxies may end
up being created too late during global destruction, after the mor-
tals stack has been emptied, and when there is not enough of the run-
time environment left for destructors to run. That will happen if
the shared object is referenced by a shared SV that is not an object.
The calling context doesn’t know about the object, so it won’t fire
the destructor at the object-destroying stage of global destruction.
Detecting circularities is also problematic: We would have to keep
a hash of ‘seen’ objects in the shared space, but then how would we
know when to free that? Letting it leak would affect embedded
environments.
So this whole trick of creating mortal proxy objects is skipped during
global destruction.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Every function that calls S_get_RV needs this same incantation:
S_get_RV(aTHX_ sv, ssv);
/* Look ahead for refs of refs */
if (SvROK(SvRV(ssv))) {
SvROK_on(SvRV(sv));
S_get_RV(aTHX_ SvRV(sv), SvRV(ssv));
}
Also, S_get_RV keeps repeating SvRV(ssv), even though it assigns it to
sobj at the top.
Also, an upcoming commit will need the ability to pass the referent to
S_get_RV.
So this patch changes S_get_RV to accept a referent instead (eliminat-
ing its multiple use of SvRV) and adds a get_RV macro to take care of
the standard calling rite.
|
|
|
|
|
|
| |
Win32 doesn't have a real execv(), so the " end up in the
command-line, interfering with the normal quoted command-line
processing.
|