| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Or potential lvalue context, like function calls.
The %n format code’s existence renders these two very much like func-
tion calls, as they can modify their arguments.
This allows sprintf("...%n", substr ...) to work.
|
| |
|
| |
|
|
|
|
|
| |
this is mostly for the benefit of the PAUSE indexer, as described
in the code comment
|
|
|
|
|
|
|
|
|
|
| |
Microsoft, in their wisdom, chose to ignore the POSIX spec when implementing
their dup2(), and have theirs return 0 on success, instead of the file
descriptor. It seems that no other vendor is this, um, "special", so code
the exception directly, as we don't run Configure on Win32, so there's little
point probing for this.
This resolves RT #98912.
|
|
|
|
|
|
|
|
| |
Previously it was a Perl wrapper for CORE::sleep, converting CORE::sleep's
return value of elapsed time slept into the POSIX return value of seconds
remaining. However, that approach could sometimes return a negative result
if CORE::sleep had slept for more than a second longer than the requested
time.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The whole point of sigsuspend and pause is to wait until a signal has
arrived, and then return *after* it has been triggered. Currently
delayed/"safe" signals prevent that from happening, which might cause
race conditions.
This patch prevents that (as far as possible) by running the signal
handlers ASAP.
|
| |
|
| |
|
|
|
|
|
|
|
| |
It’s possible for XS code to create hash entries with null values.
pp_helem and pp_slice were not taking that into account. In fact,
the core produces such hash entries, but they are rarely visible from
Perl. It’s good to check for them anyway.
|
| |
|
|
|
|
| |
without touching anything else.
|
|
|
|
|
|
|
| |
Instead of using FEATURE_IS_ENABLED("say"), etc., now use
FEATURE_SAY_IS_ENABLED instead. These new macros, in feature.h, also
check feature bundle hints in PL_hints, so we can start using those
hints. Two commits ago, feature.pm started setting them.
|
|
|
|
| |
This will make it possible to create macros for each.
|
|
|
|
|
|
|
| |
This reverts commit d54b00ad7f0e9db12ac11e897406b8888fd895bf.
I didn’t mean to push that yet, and it was more than a
version bump.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This bug is a side effect of rv2gv’s starting to return an incoercible
mortal copy of a coercible glob in 5.14:
$ perl5.12.4 -le 'open FH, "t/test.pl"; $fh=*FH; tell $fh; print tell'
0
$ perl5.14.0 -le 'open FH, "t/test.pl"; $fh=*FH; tell $fh; print tell'
-1
In the first case, tell without arguments is returning the position of
the filehandle.
In the second case, tell with an explicit argument that happens to
be a coercible glob (tell has an implicit rv2gv, so tell $fh is actu-
ally tell *$fh) sets PL_last_in_gv to a mortal copy thereof, which is
freed at the end of the statement, setting PL_last_in_gv to null. So
there is no ‘last used’ handle by the time we get to the tell without
arguments.
This commit adds a new rv2gv flag that tells it not to copy the glob.
By doing it unconditionally on the kidop, this allows tell(*$fh) to
work the same way.
Let’s hope nobody does tell(*{*$fh}), which will unset PL_last_in_gv
because the inner * returns a mortal copy.
This whole area is really icky. PL_last_in_gv should be refcounted,
but that would cause handles to leak out of scope, breaking programs
that rely on the auto-closing ‘feature’.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds the array_base feature to feature.pm
Perl_feature_is_enabled has been modified to use PL_curcop, rather
than PL_hintgv, so it can work with run-time hints as well.
(PL_curcop holds the current state op at run time, and &PL_compiling
at compile time, so it works for both.) The hints in $^H are not
stored in the same place at compile time and run time, so the FEATURE_IS_ENABLED macro has been modified to check first whether
PL_curop == &PL_compiling.
Since array_base is on by default with no hint for it in %^H, it is
a ‘negative’ feature, whose entry in %^H turns it off. feature.pm
has been modified to support such negative features. The new FEATURE_IS_ENABLED_d can check whether such default features
are enabled.
This does make things less efficient, as every version declaration
now loads feature.pm to disable all features (including turning off
array_base, which entails adding an entry to %^H) before loading the
new bundle. I have plans to make this more efficient.
|
|
|
|
|
|
| |
Support for NO_EMBED was removed by commit 22c35a8c2392967 in 1998.
Minitrue attempted to eliminate all mention of it in 2003 with commit
a0a44e237c19cc2b, but missed this code in sdbm.h
|
|
|
|
|
| |
Tiny typo on my part. Strangely, the tests passed for me before, so I
probably made a mistake in trying to switch branches.
|
| |
|
|
|
|
|
|
| |
* Moved from ext/Socket to cpan/Socket
* Currently declared as PEVANS/Socket-1.95.tar.gz - which is what it
will eventually become
|
|
|
|
|
| |
* Pass package and version to XSLoader::load to keep older perl versions happy
* Older perls do not define croak_sv; #define a workaround for them
|
| |
|
|
|
|
|
|
|
|
|
| |
On Win32 which has no native TCSANOW definition this would produce:
Constant subroutine TCSANOW redefined at ../lib/POSIX.pm line -1.
because the macro wasn't defined when building the unknown symbols
table but was defined when building the defined symbols table.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In void context we can optimise
substr($foo, $bar, $baz) = $replacement;
to something like
substr($foo, $bar, $baz, $replacement);
except that the execution order must be preserved. So what we actu-
ally do is
substr($replacement, $foo, $bar, $baz);
with a flag to indicate that the replacement comes first. This means
we can also optimise assignment to two-argument substr the same way.
Although optimisations are not supposed to change behaviour,
this one does.
• It stops substr assignment from calling get-magic twice, which means
the optimisation makes things less buggy than usual.
• It causes the uninitialized warning (for an undefined first argu-
ment) to mention the substr operator, as it did before the previous
commit, rather than the assignment operator. I think that sort of
detail is minor enough.
I had to make the warning about clobbering references apply whenever
substr does a replacement, and not only when used as an lvalue. So
four-argument substr now emits that warning. I would consider that a
bug fix, too.
Also, if the numeric arguments to four-argument substr and the
replacement string are undefined, the order of the uninitialized warn-
ings is slightly different, but is consistent regardless of whether
the optimisation is in effect.
I believe this will make 95% of substr assignments run faster. So
there is less incentive to use what I consider the less readable form
(the four-argument form, which is not self-documenting).
Since I like naïve benchmarks, here are Before and After:
$ time ./miniperl -le 'do{$x="hello"; substr ($x,0,0) = 34;0}for 1..1000000'
real 0m2.391s
user 0m2.381s
sys 0m0.005s
$ time ./miniperl -le 'do{$x="hello"; substr ($x,0,0) = 34;0}for 1..1000000'
real 0m0.936s
user 0m0.927s
sys 0m0.005s
|
|
|
|
|
|
| |
This adds an ROK check after calling sv_derived_from, as the latter
also works for class names. It is done after sv_derived_from, rather
than before, as sv_derived_from calls get-magic.
|
|
|
|
|
|
| |
There can be no other keys used with ab_ck_base but clang's static
analyzer has a point in complaining about the missing default case.
This is too fragile if any CHECK is added in BOOT.
|
|
|
|
| |
a double quotation mark.
|
| |
|
| |
|
|
|
|
|
| |
After much alternation, altercation and alteration, __SUB__ is
finally here.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is no reason why constant redefinition warnings should be
default warnings for sub foo(){1}, but not for newCONSTSUB (which
calls newXS, which triggers the warning).
To make this work properly, I also had to import sv.c’s ‘are these
const subs from the same SV originally?’ logic. Constants created
with XS can have NULL for the SV (they return an empty list or
&PL_sv_undef), which means sv.c’s logic will stop *this=\&that from
warning if both this and that are such XS-created constants.
newCONSTSUB needed to be consistent with that. It required tweaking a
test I added a few commits ago, which arguably shouldn’t have warned
the way it was written.
As of this commit (and before it, too, come to think of it),
newXS_len_flags’s calling convention is quite awful and would need to
be throughly re-thunk before being made into an API, or probably sim-
ply never made into an API.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
newCONSTSUB uses the compile-time warning hints, instead of the run-
time hints. This means that
use warnings;
BEGIN {
no warnings;
some_XS_function_that_calls_new_CONSTSUB();
}
may trigger a redefinition warning, whereas it should be analogous to
use warnings;
BEGIN {
no warnings;
*foo = \&bar;
}
which does not warn.
newCONSTSUB localises PL_curcop and sets it to &PL_compiling. When it
does that, it needs to copy the hints over.
Running tests inside eval is not reliable without a test count, so I
added one.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
Due to the '.' in 'test.lib's name, t/filenames.t fails (because '.' is the path
separator on VMS). To fix this, I create and delete the directory and its
contents during each test that needs to access the directory. Said tests will be
skipped if the directory cannot be created (e.g., on VMS).
|
| | |
|
| |
| |
| |
| | |
This fixes the podcheck error complaining about their filenames
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
$cwd already includes $volume
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
I added a whole bunch of "File::Spec"s and "File::Spec::Unix"s and I
updated the test cases and test harness to be platform independent.
I also updated some documentation in Pod::Html and removed some unneeded code.
|