| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: David Golden <dagolden@cpan.org>
|
|
|
|
|
| |
some of the filetest operators could call mg_get and/or overload fallback
stringify multiple times
|
|
|
|
|
|
|
| |
my_stat() and my_lstat() call get magic on the stack arg, so create _flags()
variants that allow us to control this. (I can't just change the signature
or the mg_get() behaviour since my_[l]stat() are listed as being in the
public API, even though they're undocumented.)
|
|
|
|
|
| |
This reduces object code size, reducing CPU cache pressure on the non-exception
paths.
|
|
|
|
|
|
|
|
|
| |
Much simplification ensues - witness the diffstat.
Changes Perl_die_unwind() to use Perl_croak() rather than DIE().
Reverses an unwise part of bb4c52e023e0fcad.
Reverts 9e95c6350a60744d and 805bf316c58ab2d7.
|
|
|
|
| |
Plus a test that would fail if it did.
|
|
|
|
|
|
| |
This generates slightly smaller object code overall, which means that the "hot"
code (the non-overloaded paths through the ops) will be smaller, and hence more
likely to stay in the CPU cache.
|
|
|
|
|
| |
Convert the gimme argument to a flags argument, and add a flag bit to signal
that mortalization is not required. Only "BINMODE" needs this.
|
|
|
|
| |
This allows "GETC" to use it.
|
|
|
|
| |
This enables "BINMODE", "EOF" and "SYSSEEK" to use it.
|
| |
|
|
|
|
|
| |
Previously the code was using XPUSH* in many cases, often to push back values
recently popped off the stack.
|
|
|
|
|
|
|
| |
If we've just POP*ed something from the stack, it will already have space.
If we conditionally POP* something from the stack, avoid the EXTEND() in that
path. Also, use PUSH() rather than XPUSH() where we know that the stack is large
enough. Changes to pp_close, pp_binmode, pp_enterwrite, pp_readlink and pp_alarm.
|
|
|
|
|
| |
Commit 32e653230c7ccc7f added this second argument, but didn't verify that the
stack always had sufficient space for it.
|
|
|
|
|
|
| |
Analogous to pp_getc and pp_tell in ac3697cd90b00fae, pp_eof has a conditional
POP from the stack, but an unconditional PUSH to the stack, but no check that
the stack had space for the PUSH. This bug has been present since perl 5.000.
|
|
|
|
|
|
| |
Both conditionally POP a GV from the stack, but always PUSH a return value to
it. For the case where they did not POP the GV, they made no check that the
stack had space for the PUSH. This bug has been present since perl 5.000.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In most places, ops checked their args for overload *before* doing
mg_get(). This meant that, among other issues, tied vars that
returned overloaded objects wouldn't trigger calling the
overloaded method. (Actually, for tied and arrays and hashes, it
still often would since mg_get gets called beforehand in rvalue
context).
This patch does the following:
Makes sure get magic is called first.
Moves most of the overload code formerly included by macros at the
start of each pp function into the separate helper functions
Perl_try_amagic_bin, Perl_try_amagic_un, S_try_amagic_ftest,
with 3 new wrapper macros:
tryAMAGICbin_MG, tryAMAGICun_MG, tryAMAGICftest_MG.
This made the code 3800 bytes smaller.
Makes sure that FETCH is not called multiple times. Much of this
bit was helped by some earlier work from Father Chrysostomos.
Added new functions and macros sv_inc_nomg(), sv_dec_nomg(),
dPOPnv_nomg, dPOPXiirl_ul_nomg, dPOPTOPnnrl_nomg, dPOPTOPiirl_ul_nomg
dPOPTOPiirl_nomg, SvIV_please_nomg, SvNV_nomg (again, some of
these were based on Father Chrysostomos's work).
Fixed the list version of the repeat operator (x): it now only
calls overloaded methods for the scalar version:
(1,2,$overloaded) x 10
no longer erroneously calls
x_method($overloaded,10))
The only thing I haven't checked/fixed yet is overloading the
iterator operator, <>.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
New functions croak_sv(), die_sv(), mess_sv(), and warn_sv(), each act
much like their _sv-less counterparts, but take a single SV argument
instead of sprintf-like format and args. They will accept RVs, passing
them through as such. This means there's no more need to clobber ERRSV
in order to throw a structured exception.
pp_warn() and pp_die() are rewritten to use the _sv interfaces.
This fixes part of [perl #74538]. It also means that a structured
warning object will be passed through to $SIG{__WARN__} instead of
being stringified, thus bringing warn in line with die with respect to
structured exception objects.
The new functions and their existing counterparts are all fully
documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Nasty code like the following results in PL_defoutgv not pointing
to a valid GV:
my $x = *STDERR; select($x); $x = 1;
This causes all sorts of SEGVs when PL_defoutgv is subsequently accessed,
because most code assumes that it has a valid gv_gp pointer. It also
turns out that PL_defoutgv is under-tested; for example, temporarily
hacking pp_close to make an arg-less close() croak didn't cause any
minitest failures.
Add a new test file that does some basic testing of a bad PL_defoutgv,
and fix all the obvious badness in accessing it.
This also fixes #20727, which although ostensibly a tie bug, was due to
PL_defoutgv pointing to a tiedelem scalar, and fun like that described
above happening.
|
|
|
|
|
|
|
|
|
|
|
| |
Otherwise gmtime(2**66) will cause a very, very, very long loop and
DOS Perl.
Add a test that very, very large times don't send gmtime and localtime into a loop
Had to fix some revealed mistakes in op/time.t when warnings were turned on.
Fix Time::gmtime and Time::localtime tests to match the new limits of gm/localtime.
|
|
|
|
|
|
|
|
|
|
|
| |
pp_sys.c: In function `Perl_pp_tie':
pp_sys.c:788: warning: 'gv' might be used uninitialized in this function
pp_sys.c: In function `Perl_pp_dbmopen':
pp_sys.c:936: warning: 'gv' might be used uninitialized in this function
pp_sys.c: In function `Perl_pp_enterwrite':
pp_sys.c:1274: warning: 'cv' might be used uninitialized in this function
pp_sys.c: In function `Perl_pp_ghostent':
pp_sys.c:4711: warning: 'hent' might be used uninitialized in this function
|
|
|
|
|
|
|
| |
POSIX requires fcntl() to return EAGAIN or EACCES, whereas BSD
requires flock() to return EWOULDBLOCK. On most systems EAGAIN
and EWOULDBLOCK use the same number, but on some (e.g. Linux on
PA-RISC) they do not.
|
|
|
|
| |
ENTER/LEAVE when debugging is enabled
|
| |
|
|
|
|
| |
warnings (the "return NORMAL"s are never reached).
|
| |
|
|
|
|
|
|
| |
You are not really outside of the string then, but the effect will
always be a noop since the number of bytes written will be capped
to not exceed the length of the string as for other offsets.
|
| |
|
|
|
|
|
|
|
| |
Replace ckWARN{,2,3,4}() && Perl_warner() with it, which trades reduced code
size (about 0.2%), for 1 more function call if warnings are not enabled.
However, if we're now in the L1 or L2 cache when we weren't previously, that's
still going to be a speed win.
|
|
|
|
| |
(fixes a bug introduced by previous patch)
|
|
|
|
|
|
|
| |
file was read
This makes tell() return -1, and sets errno to EBADF, thus
restoring the 5.8.x behaviour
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
(MacOS support was removed from MakeMaker in 6.22, and merged to blead on
15th December 2004 with 5dca256ec738057dc331fb644a93eca44ad5fa14. After this
point MacOS wouldn't even have been able to build the perl binary, because it
would not have been able to build DynaLoader. If anyone wishes to resurrect
MacOS, start by reversing this commit and the relevant part of that commit.)
|
|
|
|
|
|
|
| |
This means it should run on anything that does not have a 64-bit
integer type available but does have a double. Presumably this
includes platforms that define PERL_MICRO, so we now use the
same extended time implementation for everything that runs Perl.
|
| |
|
|\ |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All of the time64 functions are only visible within pp_sys.c and are not
part of the public API, so make them all static and give them the S_ prefix.
A side effect of this is that we now unambiguously use S_localtime64_r and
S_gmtime64_r and should no longer collide with system-supplied versions, if
any.
One possible future direction is that if and when Configure detects any
system-supplied *time64_r functions, their prototypes, and their valid
time ranges, we could optionally select those instead of the home-grown
ones.
Another possible future direction is that we could s/S_/Perl_/ and make
the *time64_r functions part of the public API in some post-5.10.x
release. Currently they are only exposed to the outside world via
Perl_pp_gmtime.
Also gave some TRACE macros more specific names.
|
|
|
|
|
|
|
| |
or gmtime
That way the overload warning won't be emitted for non-overflowing
floating point values.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The gr_gid member of struct group is being cast as an int even if
system uses an unsigned int. This patch tests for the use of an
unsigned int for the gr_gid member and casts the value as appropiate.
Created with Arthur Corliss <corliss@corliss@digitalmages.com>.
Signed-off-by: David M. Syzdek <david@syzdek.net>
|
|
|
|
|
|
|
|
|
|
| |
The y2038 code currently requires that a 64-bit integer type be available,
so the build falls down hard if we try to use it where there isn't one. A
better fix might be to try NV for time_t and a 32-bit integer for year.
N.B. We test for the definedness of Quad_t rather than HAS_QUAD since the
latter is explicitly undef'd in the case where 64-bit types are available
but are not being used for Perl's IV and UV.
|
|
|
|
| |
$tiedhandle, $buf
|
|
|
|
|
| |
As reported by Marcin Owsiany in <http://bugs.debian.org/512796>,
invoking setpgrp without any arguments could corrupt the stack.
|