| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
instead of caching it
The intent is that by not caching $$, we eliminate one opportunity for bugs:
If one embeds Perl or uses XS and calls fork(3) from C, Perls notion of $$
may go out of sync with what getpid() returns. By always fetching the
value of $$ via getpid(), this bug opportunity is eliminated. The overhead
of always fetching $$ should be small and is likely only used for tempfile
creation, which should be dwarfed by file system accesses.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
commit 20ee07fbbcfa6be9f90bb8e5474a4d69d7396617
introduced dieing in (s)printf when the format is tainted;
however it only worked when the format is part of an expression
(because TAINT_PROPER checks for PL_tainted being set).
Fix by doing TAINT_PROPER only after get magic has been done on the format
SV (which will set PL_tainted). This is done by moving the checks in
pp_sprintf and pp_prtf into do_sprintf() (which is called by the two pp
functions).
|
|
|
|
|
| |
This commit makes pp_warn stringify the warning if there is no
$SIG{__WARN__} handler. See the RT ticket for the discussion.
|
|
|
|
|
|
|
|
|
| |
Previously, if all of gethost{byaddr,byname,ent} were unimplemented on a
platform, they would all return 'Unsupported socket function "gethostent"
called', with the analogous results for getnet{byaddr,byname,ent},
getproto{byname,bynumber,ent} and getserv{byname,byport,ent}. This bug was
introduced by change af51a00e97d5c559 - prior to this, all 12 functions would
report their own name when unimplemented.
|
|
|
|
|
| |
Unlike set{host,net,proto,serv}ent, set{gr,pw}ent don't have stayopen
parameter, hence their "signature" is the same as the ent*ent functions.
|
| |
|
|
|
|
|
|
|
| |
PL_op_desc[] rather than PL_op_name(), as the OPs are internally named e*ent,
but implement the ent*ent functions, and when unimplemented report themselves
using the function name. No need for OP_DESC(), as the switch statement means
that we can't encounter OP_CUSTOM.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of having each socket op conditionally compile as either the
implementation or a DIE() depending on #HAS_SOCKET
1: remove the conditional code from the ops themselves
2: only compile the ops if HAS_SOCKET is defined
3: general conditional code for the intialisation of PL_ppaddr - as appropriate
either the ops, or Perl_unimplemented_op
4: Amend Perl_unimplemented_op to generate the appropriate DIE() for socket
ops (ie not the "panic"... message)
Whilst this complicates the support code in regen/opcode.pl, it's already a
net saving of 5 lines in the C code.
|
|
|
|
|
| |
Previously syswrite was an alias for send. However, syswrite is always
available, whereas send is not implemented if HAS_SOCKET is not defined.
|
|
|
|
|
|
|
|
|
|
|
| |
Eliminate the #define pp_foo Perl_pp_foo(pTHX) macros, and update the 13
locations that relied on them.
regen/opcode.pl now generates prototypes for the PP functions directly, into
pp_proto.h. It no longer writes pp.sym, and regen/embed.pl no longer reads
this, removing the only ordering dependency in the regen scripts. opcode.pl
is now responsible for prototypes for pp_* functions. (embed.pl remains
responsible for ck_* functions, reading from regen/opcodes)
|
|
|
|
|
|
| |
On this platform, this doesn't change the size of the object code, suggesting
that there are all transformations that the optimiser had already spotted.
However, the code is now clearer for humans.
|
| |
|
|
|
|
|
|
|
|
|
| |
# New Ticket Created by (Peter J. Acklam)
# Please include the string: [perl #81904]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=81904 >
Signed-off-by: Abigail <abigail@abigail.be>
|
|
|
|
|
| |
Add a flag TIED_METHOD_SAY to Perl_tied_method(), to allow tied PRINT to
effect C<local $\ = "\n";> within the ENTER/LEAVE pair of Perl_tied_method().
|
|
|
|
| |
It can be used for (at least) the call to "SPLICE" from pp_splice.
|
|
|
|
|
| |
This makes it clear that it's not a direct aTHX_ wrapper for
S_tied_handle_method().
|
| |
|
|
|
|
|
| |
Previously they were combined into one numeric value, using a bitshift. This
was a false economy.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Add a new flag ARGUMENTS_ON_STACK to S_tied_handle_method(), which methods
which take a list (OPEN, PRINTF, READ and WRITE) will need.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 4592e6caefc41a75, from 1999, added the PUTBACK as part of the initial
implementation of tied OPEN. At this time, pp_open (as then was) popped the
arguments off the stack (to local variables), so the new tie code pushed them
back onto the stack, before calling the method. The stack position was
manipulated, hence the local variable sp had potentially diverged from the
global PL_stack_sp, hence the latter needed updating.
Commit a567e93b903bc984, from 2001, which added support for
open $fh, '|-', @array; refactored pp_open to avoid all stack manipulation.
Hence sp (the local variable) never changes along this code path, hence it
never needs to be written back to PL_stack_sp.
|
|
|
|
| |
Consistency will make it easier to refactor.
|
|
|
|
|
|
| |
Simplify tests of !gv || !io to just !io, avoid calling GvIO(gv) more than
once, and where possible initialise io at declaration time, to allow it to be
const.
|
|
|
|
|
|
|
|
| |
Due to the way that '<> as glob' was parsed differently from
'<> as filehandle' from 5.6 onwards, something like <$foo[0]>
didn't handle overloading, even where $foo[0] was an overloaded object.
This was contrary to the docs for overload, and meant that <> couldn't
be used as a general overloaded iterator operator.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently when an external Perl glob function is used (which is most of
the time), the OP_GLOB op is removed and replaced with the pair:
GV("CORE::GLOBAL::glob"), ENTERSUB.
This commit re-adds the OP_GLOB to the op tree, but with OPf_SPECIAL set;
and pp_glob() is updated to just return if OPf_SPECIAL is set.
Thus there's no change in outward functionality with this commit. However,
by always calling pp_glob(), it will allow us (in the next commit) to
handle iterator overloading consistently, regardless of whether the
internal globbing function is used or not.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some amagic-related macros take the full method enumeration name,
(e.g. "add_amg"); while others "helpfully" allow you to pass a shortened
version, ("add"), and do a CAT2(meth,_amg) behind the scenes.
Standardise on passing the full name; this makes it less confusing and
allows you to grep for the enumeration name in the source.
It updates two macros to accept full enumeration names: tryAMAGICunTARGET
(which isn't used outside the core apparently), and AMG_CALLun, which is
replaced by a new AMG_CALLunary (since AMG_CALLun is used outside the
core).
|
| |
|
|
|
|
|
|
| |
They were checking that category 'closed' was enabled for warnings before
calling report_evil_fh(), which in turn was (correctly) checking category
'unopened'.
|
|
|
|
|
| |
It was checking that category 'closed' was enabled for warnings before calling
report_evil_fh(), which in turn was (correctly) checking category 'unopened'.
|
|
|
|
|
|
|
|
|
|
| |
This trades reduced code size for an extra function call in the error path with
warnings disabled. (And removes a duplicated check for the case of taking the
error path *with* warnings enabled.)
Removing the check from Perl_do_close() does not change behaviour, as io is
NULL there, hence Perl_report_evil_fh() will always be checking WARN_UNOPENED
and setting vile to "unopened".
|
|
|
|
|
|
| |
This trades reduced code size for an extra function call in the error path with
warnings disabled. (And removes a duplicated check for the case of taking the
error path *with* warnings enabled.)
|
| |
|
| |
|
|
|
|
|
| |
Previously Perl_report_evil_fh()'s body was just an if/else at the top level -
a good sign that it is actually implementing two disjoint functions.
|
|
|
|
|
|
| |
It's not necessary to (also) test gv1 and gv2 before returning undef as an
error, because io1 will automatically be NULL if gv1 is NULL, and similarly
io2 if gv2 is.
|
|
|
|
|
|
|
| |
That should be gv2, not gv1. However, I believe that it's impossible to reach
the warning code, given the structure of the optree that the perl 5
implementation produces, as gv1 and gv2 will never be NULL, and GvIOn() will
always return non-NULL. (Or croak, but that won't return).
|
|
|
|
|
| |
pp_sys.c: In function ‘Perl_pp_send’:
pp_sys.c:1845: warning: operation on ‘sp’ may be undefined
|
|
|
|
|
|
|
|
| |
Their code used to explicitly move the return value from its current position
on the stack, to the position that was top of top of the stack just before the
call was made. However, the POPBLOCK() in pp_leavesub will restore the stack
pointer, and passing G_SCALAR to call_method() will force exactly one return
value, so all of this is needless defensiveness.
|
|
|
|
|
|
|
|
|
|
|
| |
__priority_which_t does not exist on glibc 2.1.
sin6_scope is not present in the set of kernel headers my copy of glibc 2.1 is
using. (The presence of sin6_scope in sockaddr_in6 should maybe be a Configure
test.)
blead now compiles on a positively ancient box -- although the Socket tests
fail.
|
| |
|
| |
|
|
|
|
| |
This reverts commit 8752206e276cffe588c0932b5a9f2331640e8447.
|
|
|
|
| |
This reverts commit 9aa8b00892d81bb5e94565d3cb9841dd57b7b9cf.
|
|
|
|
| |
This reverts commit 830748013f81bcc28d145baf4024efd1b6537704.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The recv() system call, with the MSG_TRUNC flag, returns the
true size of the packet, even if it is larger than the supplied buffer.
Since perl's equivalent recv() function doesn't return the size
(apart from what's implied as the returned length of the buffer), there
doesn't seem to to be any way to return this value to the caller. So
silently ignore it.
Before, we were setting SvCUR to the size, even if it was larger than
the buffer. Which was Bad.
|
|
|
|
|
| |
This allows untie($scalar) to untie the scalar if the last assigned or
returned happened to be a typeglob.
|