| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
This turned out to be harmless, as sv_setpvn_fresh() does nothing
when h_addr is NULL, but the call is also unnecessary when h_addr
is NULL, and possibly confusing to future maintainers.
CID 343917
|
|
|
|
|
|
|
|
|
|
| |
In a few places, SVs can be created more efficiently or new SVs
can be assigned to more efficiently. Small changes included:
* Use sv_setpvn_fresh instead of sv_setpvn
* Use sv_mortalcopy_flags instead of sv_newmortal + sv_setsv_flags
* newSVsv_flags instead of newSV + sv_setsv_flags
* sv_newmortal instead of sv_2mortal(newSV(0))
* Remove a SvGROW(sv, 257) following a newSV(257)
|
|
|
|
| |
The same holds for newSVpvs* wrappers around newSVpvn* functions.
|
| |
|
| |
|
|
|
|
| |
The build has been broken since 2009.
|
|
|
|
|
|
|
|
|
| |
Previously the state was only freed at the point when the hash was iterated
again, or re-tied, or destroyed.
This shouldn't make any difference to sane code, but the change can be
detected with suitably pathological pure-Perl code, so someone might just
(unwisely) be relying on this undocumented implementation detail.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On FreeBSD dev_t (and hence the st_dev member of struct stat) is an
unsigned 64-bit integer, and the previous simple PUSHi() corrupted
that.
A previous version of this reflected the st_ino code and implemented
our own number to string conversion, but a system with such a large
st_dev should be assumed to have inttypes.h, and an intmax_t which is
no smaller than st_dev.
The st_ino code could probably be changed similarly, but 64-bit inode
numbers are not a new thing, so it may be riskier.
|
|
|
|
|
|
|
|
|
| |
Previously it would mangle it, resetting EITER but not RITER, meaning that
after untie continuing iteration would be inconsistent - normally it would
carry on exactly where it left off, but if iteration had been in the middle
of a chain of HEs, it would skip the rest of the chain.
Fixes GH #19077
|
|
|
|
| |
The former doesn't make a function call.
|
|
|
|
|
|
|
|
| |
The code here checked SV flags before fetching magic, potentially
getting confused if magic fetched changed flags.
This also fixes handling for upgraded SVs, but I'm not sure that can
be tested sufficiently portably.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This just detabifies to get rid of the mixed tab/space indentation.
Applying consistent indentation and dealing with other tabs are another issue.
Done with `expand -i`.
* vutil.* left alone, it's part of version.
* Left regen managed files alone for now.
|
|
|
|
|
|
|
|
| |
The API used requires Windows Vista or later.
The API itself requires either elevated privileges or a sufficiently
recent version of Windows 10 running in "Developer Mode", so some
tests require updates.
|
|
|
|
| |
fixes #18293
|
|
|
|
|
|
|
|
|
|
|
| |
This feature allows documentation destined for perlapi or perlintern to
be split into sections of related functions, no matter where the
documentation source is. Prior to this commit the line had to contain
the exact text of the title of the section. Now it can be a $variable
name that autodoc.pl expands to the title. It still has to be an exact
match for the variable in autodoc, but now, the expanded text can be
changed in autodoc alone, without other files needing to be updated at
the same time.
|
|
|
|
|
| |
This uses a new organization of sections that I came up with. I asked
for comments on p5p, but there were none.
|
| |
|
|
|
|
|
| |
Also eliminate USE_HEAP_INSTEAD_OF_STACK and
SETSOCKOPT_OPTION_VALUE_T, since Symbian was the only user of those.
|
|
|
|
|
| |
Mostly in comments and docs, but some in diagnostic messages and one
case of 'or die die'.
|
|
|
|
|
|
| |
When it's possible, use sizeof(struct sockaddr_storage).
fixes #17761
|
|
|
|
|
|
|
|
|
| |
It turns out that even though the headers correctly define the argument
as `int` under C++, -Wc++-compat doesn't know this.
Add a comment to stop others from falling into the same trap I did.
This reverts commit 34d254cefc451e5ab438acf22a51d7b557c05a0e.
|
| |
|
|
|
|
|
|
|
| |
Glibc has enum typedefs for some arguments that are defined as `int`
by the X/Open standard. This is fine in C, but until glibc
2.3 (released in 2002) this was also done for C++, which is not
allowed.
|
| |
|
|
|
|
| |
Else, DIE() will bever be executed.
|
|
|
|
| |
We have a macro to hide the details of this; use it
|
|
|
|
|
| |
When no file has previously been opened, "eof" should return true. This
behavior was broken by 32e653230c7ccc (see also [#60978]).
|
|
|
|
|
|
| |
Per: https://lgtm.com/projects/g/Perl/perl5/alerts/?mode=tree&ruleFocus=2154840804
For: RT 133686 (partial)
|
|
|
|
|
|
| |
Unlike every other platform's access() or equivalent (and as required
by POSIX), AIX doesn't declare the path argument to access() and
accessx() as const char*, so cast the const away.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This includes removing the :utf8 logic from pp_syswrite. pp_sysread
retains it, since it's also used for read().
Tests that are specifically testing the behaviour against :utf8
handles have been removed (eg in lib/open.t), several other tests
that incidentally used those functions on :utf8 handles have been
adapted to use :raw handles instead (eg. op/readline.t).
Test lib/sigtrap.t fails if STDERR is :utf8, in code from the
original 5.000 commit, which is intended to run in a signal handler
|
|
|
|
| |
RT #132602
|
|
|
|
|
|
| |
This reverts commit 523d71b314dc75bd212794cc8392eab8267ea744, reinstating
commit 2cdf406af42834c46ef407517daab0734f7066fc. Reversion is not the
way to address the porting problem that motivated that reversion.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 2cdf406af42834c46ef407517daab0734f7066fc.
The reason for the revert is that with this commit, perl fails to
compile on darwin (or at least, one some versions of it):
./miniperl -Ilib make_ext.pl lib/auto/DB_File/DB_File.bundle MAKE="/Applications/Xcode.app/Contents/Developer/usr/bin/make" LIBPERL_A=libperl.a LINKTYPE=dynamic
Parsing config.in...
Looks Good.
dyld: lazy symbol binding failed: Symbol not found: _mkostemp
Referenced from: /private/tmp/perl/cpan/DB_File/../../miniperl
Expected in: flat namespace
dyld: Symbol not found: _mkostemp
Referenced from: /private/tmp/perl/cpan/DB_File/../../miniperl
Expected in: flat namespace
Unsuccessful Makefile.PL(cpan/DB_File): code=5 at make_ext.pl line 518.
make: *** [lib/auto/DB_File/DB_File.bundle] Error 2
|
|
|
|
|
|
|
| |
This was broken in 64def2aeaeb63f92dadc6dfa334, and fixed for Win32
only in 8fe3452cc6ac7af8c08. But VMS also uses a numeric first
argument to system() as a flag indicating spawn without waiting for
completion.
|
|
|
|
|
|
| |
Move handling of close-on-exec flag for PerlIO handles into PerlIO itself.
Where PerlIO opens new file descriptors, have them opened in O_CLOEXEC
mode where possible.
|
|
|
|
|
|
|
| |
In many places where a file descriptor is being opened, open it with
FD_CLOEXEC already set if possible. This commit covers the easy cases,
where the file descriptor arises without the use of PerlIO, pp_open,
or my_popen.
|
|
|
|
|
|
|
|
|
|
|
| |
On Windows there's a nasty variation in the meaning of arguments
to Perl's system(), in which a numeric first argument isn't used as
part of the command to run, but instead selects between two different
operations to perform with the command (whether to wait for the command
to complete or not). Therefore the reduction of argument scalars to
their operative values in the parent process, which was added in commit
64def2aeaeb63f92dadc6dfa33486c1d7b311963, needs to preserve numericness
of arguments on Windows. Fixes [perl #132633].
|
|
|
|
|
|
| |
New macros {GCC,CLANG}_DIAG_{IGNORE,RESTORE}_{DECL,STMT}, which take a
following semicolon. It is necessary to use the _DECL or _STMT version
as appropriate to the context. Fixes [perl #130726].
|
|
|
|
|
|
|
|
|
|
| |
A lot of things can happen when stringifying an argument list: side
effects, warnings, exceptions. In the case of system(), these effects
should happen in the context of the parent process. The stringification
can also depend on which process it happens in, as in the case of
$$, and in that case it should also happen in the parent process.
Therefore reduce the argument scalars to strings first thing in pp_system.
Fixes [perl #121105].
|
|
|
|
|
|
|
|
|
|
| |
Bits of exec code were putting the constructed commands into globals
PL_Argv and PL_Cmd, which could then be clobbered by reentrancy.
These are only global in order to manage their freeing, but that's
better managed by using the scope stack. So replace them with automatic
variables, with ENTER/SAVEFREEPV/LEAVE to free the memory. Also copy
the strings acquired from SVs, to avoid magic clobbering the buffers of
SVs already read. Fixes [perl #129888].
|
|
|
|
|
|
|
| |
When a filetest op returns false, it skips past following ops that
are stacked filetests. The code to do this was assuming that op_next
would always be non-null, which is not always the case, for example in
a sort comparator. Allow for it to be null. Fixes [perl #129347].
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commits 8843856e9716655549cce789b3338e1d4c72fffb,
3676f9e77d46b61f4785aad171f02bed29df0c07, and
793c2ded15ca832d1df1fabbc3b2e7562a057697.
As noted in the large comment above the relevant code, the probed
ST_INO_SIGN is not reliable enough for its purpose, because Configure
makes guesses. The actual compiler knows whether st_ino is signed,
and is perfectly capable of optimising out the negative-handling code
in the usual case that st_ino is unsigned, without any need for us to
preprocess it away.
|
|
|
|
|
|
| |
In platforms with st.ino always positive, never even see the negative code.
Coverity #169271.
|
|
|
|
| |
(Solaris cc got angry.)
|
|
|
|
|
| |
And therefore one may not be able to subtract the pointers,
for example in HP-UX.
|
|
|
|
| |
(Like HP-UX.)
|
|
|
|
|
|
|
| |
By using is_utf8_invariant_string_loc() instead of plain
is_utf8_invariant_string(), we can start parsing at the first variant
(if any is found) instead of the previous behavior of starting again at
the beginning of the string.
|
|
|
|
|
|
|
|
|
|
| |
The file test operators for Unix permission bits were returning a blanket
false result on systems where the bit being tested for doesn't exist.
That's a sensible way to treat a nonexistent bit when statting a file,
but the false result was being returned without checking that the argument
actually refers to a file. Remove the pre-stat checks for nonexistent
bits, so that we get the correct errors for non-files. We still get a
blanket false result for nonexistent bits on files.
|
|
|
|
|
|
|
| |
When a stat fails because it's on a closed or otherwise invalid
filehandle, $! was often not being set, depending on the operation
and the nature of the invalidity. Consistently set it to EBADF.
Fixes [perl #108288].
|