| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Win32CORE.c is shipped as a C file, not built by ExtUtils::ParseXS, so needs
to be manually updated to reflect the change of default in XSUB.h
|
|
|
|
|
|
| |
These are used in other compilation units. The declarations there
use the XS_EXTERNAL macro to indicate an non-static XSUB that is
taken from another object file.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This commit allows &CORE::wantarray to be called via ampersand syntax
or through references.
It adds a new private flag for wantarray, OPpOFFBYONE, which caller
will use as well, telling wantarray (or caller) to look one call fur-
ther up the call stack.
|
|
|
|
| |
&CORE::foo subs will use this operator for sorting out @_.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See the thread starting at:
http://www.nntp.perl.org/group/perl.perl5.porters/2011/07/msg175161.html
Instead of assuming that only Perl subs have mallocked CvFILEs and
only under threads, resulting in various hackery to borrow parts of
the SvPVX buffer where that assumption proves wrong, we can simply
add another flag (DYNFILE) to indicate whether CvFILE is mallocked,
instead of trying to use the ISXSUB flag for two purposes.
This simplifies the code greatly, eliminating bug #96126 in the pro-
cess (which had to do with sv_dup not knowing about the hackery that
this commit removes).
I removed that comment from cv_ckproto_len about CONSTSUBs doubling up
the buffer field, as it is no longer relevant. But I still left the
code as it is, since it’s better to do an explicit length check.
|
| |
|
| |
|
|
|
|
|
|
|
| |
For the default (non-multiplicity) configuration, PERLVAR*() macros now
directly expand their arguments to tokens such as C<PL_defgv>, instead of
expanding to C<PL_Idefgv>. This removes over 350 lines from F<embedvar.h>,
which defined macros to map from C<PL_Idefgv> to C<PL_defgv> and so forth.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Correct the socketsize. Probably due to big-endian versus
little-endian, this has always worked on Intel CPUs. This
is a very very old problem, and it has been the reason I
never used gcc-4 on PA-RISC, because perl would not pass
the test suite in 64bitall.
Noticeable effects of wrong "$socksizetype" are return codes
of 0 (pass) from functions like getpeername (), but invalid
(or none) data in the returned structures or a return length
of 0 or 256. In the latter case, the length is stored in the
second part of the 64bit long and the 32bit first part is 0.
This might be true on Intel-like machines too, but the tests
will pass, as the significant part of the returned length is
in the first 32bits and a pointer to int will still see that
correct. Mind that in that case the 32bits after that might
have been overridden => can of worms.
|
| |
|
|
|
|
|
|
|
|
| |
IPC::Open3::open3($in, $out, $err, '-') is broken in 5.14.1
Because the old "return 0" used to return to user code now is wrapped inside and eval block.
This patch solves the problem.
|
| |
|
|
|
|
| |
Signed-off-by: Abigail <abigail@abigail.be>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
commit 3c78429c102e0fe2ad30c60dfe52636b6071ef19 reduced the depth
of recursion in rpeep(), by deferring recursion into branches until a bit
later (so that the recursive call to rpeep was then likely to be shallow).
However, it went one step further: when the chain of op_next's had been
exhausted in the main loop, it processed any remaining deferrred branches
in the main loop rather than recursing. All nice and efficient, but it
broke the expectation that someone who had hooked into rpeep could follow
the chain of op_nexts in each call and visit *all* ops.
This commit removes that optimisation and restores the rpeep hook
expectancy. This shouldn't have any major effect on the depth of
recursion, and its minor inefficiency doesn't really matter for a
one-time compilation-time pass.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
8375c93eec supplied tests for a newly exported API but the type
declarations for the arguments and return values didn't match the
types of the API being tested.
aebc0cbee0 renamed the functions without updating the calls to
those functions in the test.
Either of these could have been easily spotted by building with
g++ (or other readily available tools) before pushing.
This aside from the controversy over whether this particular API
is the one that should be publicly exported, so this all may be
reverted and replaced before 5.16.0, but hopefully it will unbreak
the build for now.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Long blocks of code that include logical or loop ops (i.e. those with
multiple 'branches' of ops, such as op_other, op_redo etc) cause
Perl_rpeep to recurse deeply and eventaully SEGV.
For example this crashes, due to the ENTERLOOP:
eval ("{\$x = 1 }\n" x 10000)
The deep recursion happens because the processing of the entire rest of
the code occurs in within the nested call. For example in the code
A && B; C; D; E;
the ops are structured as
A -> AND -> C -> D -> E
\ /
B
where AND->op_next points to C, while AND->op_other points to B.
rpeep() would normally process each op in the op_next sequence in turn
(i.e. A/AND/C/D/E), but when it reaches AND, it recursively calls
rpeep(B), which happens to then process B/C/D/E. Finally it returns,
and the parent rpeep processes C, finds it's already done, and exits.
Clearly, if C,D,E etc also contain conditional/loop ops, then the
recursion level gradually stacks up.
The fix for this is to add a small deferred queue to rpeep().
Whenever rpeep wants to recurse with op_other or op_lastop etc,
it instead adds it to the deferred queue. Only if the queue is full is
rpeep actually called. The hope is that by deferring, when we do
eventually process it, enough of the main op_next chain has already been
processed to ensure that the child rpeep returns very early.
In the example above, processing of AND causes B to be added to the queue,
and the main rpeep process continues processing C, D etc. Sometime later,
the queue becomes full and B is processed via a recursive call to rpeep.
B is processed, and op_next is followed to C, but C is marked as already
processed, so the child rpeep returns almost immediately.
For LOOP ops, I've stopped following op_redoop and op_nextop, since
AFAIKT the ops these point to will also be reachable vie op_next anyway.
op_lastop is the exception; in while(1){..} only op_lastop points to the
rest of the code block.
Note that this commit doesn't guarantee only shallow recursion, it just
makes deep recursion fairly unlikely.
Note also that this commit causes the order of the processing of op_next
chains to be altered; this can affect the ordering of compiler warnings
and fatal messages among potentially other things.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Move several pad functions into the core API. Document the pad
functions more consistently for perlapi. Fix the interface issues
around delimitation of lexical variable names, providing _pvn, _pvs,
_pv, and _sv forms of pad_add_name and pad_findmy.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Much of ExtUtils::ParseXS was rewritten and cleaned up.
It has been made somewhat more extensible and now finally
uses strictures.
The logic for parsing, merging, and dumping XS typemaps was extracted
from ExtUtils::ParseXS into a module of its own, ExtUtils::Typemaps.
ExtUtils::Typemaps offers an interface to typemap handling outside of
the scope of the XS compiler itself.
As a first use case of the improved API an extensibility, typemaps can now
be included inline into XS code with a HEREDOC-like syntax:
TYPEMAP: <<END_TYPEMAP
MyType T_IV
END_TYPEMAP
|
| |
| |
| |
| |
| |
| |
| | |
change from yesterday""
This reverts commit cf8fc7eed929846d31d02d565b4d5f4480a18d69,
reinstating the move of the prototype check to XS code.
|
| |
| |
| |
| |
| |
| |
| |
| | |
yesterday"
This reverts commit d16d4b10300b35e2d4d858a3e23cff975bc713fe. It
requires the _ prototype support in ExtUtils::ParseXS and we need to
temporarily disable that. Will be reapplied later.
|
|/
|
|
|
|
|
|
| |
SvIsCOW was ignoring the fact that it might be passed a
typeglob, which made its behaviour contradict its docs.
This fixes that and, in doing so, simplifies the
upcoming Internals::SvREADONLY fix.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The original bug report states
if we try to dup STDIN in a child process by using it's file descriptor
but has code to dup 1, not 0:
perl -MIPC::Open3 -wle 'open3("<&1", my $out, undef, $^X)'
Change the above code to "<&0" and the same bug is demonstrated, and fixed by
the relevant change.
However, trying to open descriptor 1 for input causes subtle portability
problems, which conceal the actual bug we're attempting to test. On most
platforms the terminal is read write, and a command tested on the command line
actually has file descriptor 1 read/write (and probably file descriptor 0 also)
When the output is being piped, for example in a test checking the output,
descriptor 1 is (likely to be) write only. PerlIO is quite happy to *open* a
such a numeric file descriptor for reading, and will only generate an error if
an actual read is attempted (which this test does not). stdio (on several
platforms tested) fails the *open* in the same scenario. Hence whether this
*test* passed or failed depended on the IO system used, which is actually not
what we want to test.
Original test added in a0ed8b7b5f7f6d6f, fix added in fb9b5b31d8a62644.
|
| |
|
|
|
|
|
| |
CLONEf_COPY_STACKS is only used by the windows pseudo-fork.
This test allows testing/debugging of CLONEf_COPY_STACK without needing threads or Windows.
|
|
|
|
|
|
|
| |
The assumption is that most studied strings are fairly short, hence the pain
of the extra code is worth it, given the memory savings.
80 character string, 336 bytes as U8, down from 1344 as U32
800 character string, 2112 bytes as U16, down from 4224 as U32
|
|
|
|
|
| |
This allows more than one C<study> to be active at the same time.
It eliminates PL_screamfirst, PL_lastscream, PL_maxscream.
|
|
|
|
|
|
| |
study uses magic to call SvSCREAM_off() if the scalar is modified. Allocate it
its own magic type ('G' for now - pos magic is 'g'). Share the same "set"
routine and vtable as regexp/bm/fm (setregxp and vtbl_regexp).
|
|
|
|
|
|
|
|
| |
This is something that ‘sub foo :lvalue;’ declarations do. This brings
attributes.pm in line with them.
See commits fff96ff and 885ef6f, ticket #68758, and
<364E1F98-FDCC-49A7-BADB-BD844626B8AE@cpan.org>.
|
|
|
|
| |
I’m about to make changes to it.
|
|
|
|
|
| |
IPC::Open2::open2() is implemented as a thin wrapper around
IPC::Open3::_open3(), and hence is very tightly coupled to it.
|
|
|
|
|
| |
For threaded platforms, this reduces the object code size, and should slightly
reduce CPU usage.
|
|
|
|
| |
Hopefully this will get smoke reports to pass again on Windows.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes a regression introduced since 5.14.0, by commit e0171a1a3.
The new Perl_hfree_next_entry function that that commit introduced
returns the value of the hash element, or NULL if there are none left.
If the value of the hash element is NULL, the two cases are indistin-
guishable.
Before e0171a1a3, all the hash code took null values into account.
mro_package_moved took advantage of that, stealing values out of a
hash and leaving it to the freeing code to delete the elements.
The two places that call Perl_hfree_next_entry (there was only one,
S_hfreeentries, with commit e0171a1a3, but the following commit,
104d7b699c, made sv_clear call it, too) were not accounting for NULL
values’ being returned, and could terminate early, resulting in mem-
ory leaks.
One could argue that the perl core should not be assigning nulls to
HeVAL, but HeVAL is part of the public API and there could be CPAN
code assigning NULL to it, too.
So the safest approach seems to be to modify Perl_hfree_next_entry’s
callers to check the number of keys and not to attribute a signifi-
cance to a returned NULL.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
6a077020aea1c5f0 extended the OP_AELEMFAST optimisation to lexical arrays.
Previously OP_AELEMFAST was only used as an optimisation for OP_GV, which is a
PADOP/SVOP.
However, by reusing the same opcode, and signalling (pad) lexical vs package,
it introduced a myriad of special cases, because OP_PADAV is a BASEOP (not a
PADOP), whilst OP_AELEMFAST is a PADOP/SVOP (which is larger).
Using two OP numbers allows each variant to have the correct OP flags in
PL_opargs. Both can continue to share the same C code.
|
|
|
|
| |
These all pass now as of commit b56985536ef7.
|
|
|
|
|
| |
Also, in Perl_sv_magic() merge the case for PERL_MAGIC_dbfile with the others
that return a NULL vtable.
|
| |
|
|
|
|
|
|
|
|
| |
This should reduce the complexity of code dealing with GVs, as they no longer
try to play several different incompatible roles.
(As suggested by Ben Morrow. However, it didn't turn out to be as
straightforward as one might have hoped).
|