| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These were occurring on FreeBSD smokes.
warning: implicit conversion from 'IV' (aka 'long') to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Wimplicit-int-float-conversion]
9223372036854775807 is IV_MAX. What needed to be done here was to use
the NV containing IV_MAX+1, a value that already exists in perl.h
In other instances, simply casting to an NV before doing the comparison
with the NV was what was needed.
This fixes #18328
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
Fix #18063
During global destruction make sure we preserve
the string by using mortalcopy.
This is an update on 8c86f0238ecb5f32c2e7fba36e3edfdb54069068
change which avoided sv_mortalcopy in favor of sv_2mortal.
|
| |
|
|
|
|
|
| |
It only does anything under PERL_GLOBAL_STRUCT, which is gone.
Keep the dNOOP defintion for CPAN back-compat
|
|
|
|
|
| |
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'.
|
|
|
|
|
|
|
|
|
|
|
| |
Previously require would check for the specific \&PL_sv_undef
SV in %INC, this meant that if %INC was copied, or undef
assigned to a member the entry would erroneously be treated as if
a previous require of that file was successful.
So check for SvOK() instead, with appropriate magic tests.
fixes #17428
|
|
|
|
|
|
|
|
|
|
|
| |
This includes:
- remove them from the API
- simplify quadmath_format_single()'s interface, and rename it
to match the new interface
fixes #17288
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Perform only a bit check instead of a much more expensive hash
lookup to test features.
For now I've just added a U32 to the cop structure to store the bits,
if we need more we could either add more bits directly, or make it a
pointer.
We don't have the immediate need for a pointer that warning do since
we don't dynamically add new features during compilation/runtime.
The changes to %^H are retained so that caller() can be used from perl
code to check the features enabled at a given caller's scope.
|
|
|
|
|
|
|
| |
My recent merge commit v5.31.3-198-gd2cd363728 (temporarily reverted by
v5.31.4-0-g20ef288c53) added a si_cxsubix field to the stackinfo struct
to track the most recent sub context. This field wasn't being restored
correctly with 'goto &XS-sub', and broke Test::Deep.
|
|
|
|
|
|
|
|
| |
original merge commit: v5.31.3-198-gd2cd363728
reverted by: v5.31.4-0-g20ef288c53
The commit following this commit fixes the breakage, which that means
the revert can be undone.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit d2cd363728088adada85312725ac9d96c29659be, reversing
changes made to 068b48acd4bdf9e7c69b87f4ba838bdff035053c.
This change breaks installing Test::Deep:
...
not ok 37 - Test 'isa eq' completed
ok 38 - Test 'isa eq' no premature diagnostication
...
|
|
|
|
|
|
| |
This function makes use of PL_curstackinfo->si_cxsubix to avoid the
overhead of a call to block_gimme() when the context of the op is
unknown.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This tracks the most recent sub/eval/format context pushed onto the
context stack. Then make dopopto_cursub use it.
The previous value is saved in the cxt struct, and is restored whenever
the context is popped.
This adds a tiny overhead for every sub call, but speeds up other
operations, such as determining the caller context when returning a
value from a sub - this has to be dpne for every sub call where the last
expression is context sensitive, so its often a win.
|
|
|
|
| |
short for dopoptosub(cxstack_ix), a common idiom in that file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
RT #134409
In a repeated substitution, where the replacement is an expression,
and when the last replacement value is both tainted and utf8, and
everything earlier has been plain, and the final string is suitably
shorter than the original, a panic resulted:
sv_pos_b2u: bad byte offset, blen=1, byte=6
This is because when at the end, taint magic is being being added to
the target of the s///, the target SV has already had its buffer updated
with the shorter result string, but still has the pos() magic set which
corresponded to the original longer string (this pos value would, in the
normal flow of things, be reset shortly afterwards).
One quirk of sv_magic(), which adds any sort of magic including taint
magic, is that it always checks for the presence of pos() magic, and if
so, converts the byte to utf8 offset if necessary. This was seeing the
invalid pos() offset and panicing.
The check was added by v5.19.3-111-g25fdce4a16:
"Stop pos() from being confused by changing utf8ness"
It seems like a bit of hack to recalibrate pos() each time sv_magic()
is called, but I've left that alone (sleeping dogs and all that) and
instead added a hack in the taint code path in pp_substcont to reset pos
before setting taint.
|
|
|
|
|
|
|
|
| |
when unwinding.
Since except_sv might be ERRSV we try to preserve it's value,
if not the actual SV (which we have an extra refcount on if it is
except_sv).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, *any* string beginning with 0, including the string "0"
itself, would be subject to the magic string auto-increment, instead of
being treated like a number. This meant that "-2".."-1" was the same as
-2..-1 and "1".."-1" was the same as 1..-1, but "0".."-1" was the same
as "0".."99".
This patch fixes that inconsistency, while still allowing ranges like
"01".."31" to produce the strings "01", "02", ... "31", which is what
the "begins with 0" exception was intended for.
This patch also expands the documentation in perlop and states the rules
for the range operator in list context with both operands being strings
more explicitly.
See also #18165 and #18114.
|
| |
|
|
|
|
|
| |
This moves calculations definitely to compile time; some optimizing
compilers may already do this, but some may not.
|
|
|
|
|
|
|
|
|
|
|
|
| |
$ ./perl -Ilib -Xe 'goto foo; glob do { foo: $1}'
Can't "goto" into a binary or list expression at -e line 1.
What binary or list expression? True, glob has the *precedence* of a list operator, but so does not:
$ ./perl -Ilib -Xe 'goto foo; not do { foo: $1}; prt "ok\n"'
ok
Glob seems to be the only exception, due to its ‘special’ op tree.
|
|
|
|
|
| |
This particular case does not risk any stack corruption, and there is
a CPAN module depending on it working (PerlX::AsyncAwait).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When goto looks for a label, it builds up a list of ops to enter. But
it begins its search a little too far out relative to the ‘goto’.
Hence, the first op gets skipped.
In 6d90e983841, I forbade same cases of inward goto-into-expression to
avoid stack corruption and crashes. I did this by pushing a marker
on to the list of ops to enter, indicating that an error should be
thrown instead.
Because goto starts the search too far up the context stack, it would
sometimes end up looking inside an expression, which would cause the
first op on the entry list to be such a marker, meaning that the next
item, which should have been skipped, would not be.
That could really screw up the context stack for cases like:
my $e = eval { goto label; label: }
because the entry list would be:
<croak-marker> entertry
instead of the previous:
entertry
Hence, entertry (which enters eval{}) would be executed from *within*
the eval, causing the exit of the eval to leave an eval on the context
stack. Crashes ensued.
This commit fixes it by checking whether we have moved past the begin-
ning of the list of entry ops before pushing a croak-marker on to it.
Goto’s implementation is really complex, and always has been. It
could be greatly simplified now thot ops have parent pointers. But
that should wait for another developement cycle.
|
|
|
|
|
|
|
|
|
|
| |
More precisely, goto-to-jump-into-the-parameter-of-a-string-eval,
which is tested in goto.t as of 6d90e98384, but fails as of that
commit under PERL_UNICODE, because entereval gets a second kid
op (a hintseval op) and ‘looks like’ a list operator, which
6d90e98384 generally forbad.
The easiest way to fix this is simply to add another exception.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit in general forbids entry into the parameter of a binary or
list operator, to avoid crashes and stack corruption.
In cases like
goto f;
push @array, do { f: }
and
goto f;
$a + do { f: };
it’s not possible to fix this in general. Cases like
goto f;
do { f: } + $a;
(jumping into the first parameter) have never caused problems, but I
went ahead and forbad that usage too, since it would be too compli-
cated to figure out exactly which parameter is being jumped into.
(It’s not impossible; it would just double the amount of code used to
find labels.)
List operators taking just a simple list, such as die(), have never
worked properly, because goto() bypasses the pushmark. They could be
made to work, but that would require extra work to distinguish cases
like push and print that have a first operand (sometimes implicit for
print) of a specific type. I figured it was easier just to forbid
jumping into any list operator. It’s also much easier to document.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The pumpking has determined that the CPAN breakage caused by changing
smartmatch [perl #132594] is too great for the smartmatch changes to
stay in for 5.28.
This reverts most of the merge in commit
da4e040f42421764ef069371d77c008e6b801f45. All core behaviour and
documentation is reverted. The removal of use of smartmatch from a couple
of tests (that aren't testing smartmatch) remains. Customisation of
a couple of CPAN modules to make them portable across smartmatch types
remains. A small bugfix in scope.c also remains.
|
|
|
|
| |
Fixes [perl #132634].
|
| |
|
|\ |
|
| |
| |
| |
| |
| | |
The names of ops, context types, functions, etc., all change in accordance
with the change of keyword.
|
| | |
|
| |
| |
| |
| |
| | |
The leaveloop op type can already do the whole job, with leavegiven being
a near duplicate of it. Replace all uses of leavegiven with leaveloop.
|
| |
| |
| |
| |
| |
| | |
The message for leaving a "when" block outside a loop had different
wording from the message for performing "next" et al outside a loop.
Make the "when" message consistent with the existing loop control ones.
|
| |
| |
| |
| |
| | |
These were used to identify foreach loops that qualify as topicalizers.
That's no longer a relevant classification.
|
| |
| |
| |
| |
| |
| |
| |
| | |
A "when" construct, upon reaching the end of its conditionally-executed
block, used to perform an implicit jump to the end of the enclosing
topicalizer, defined as either a "given" block or a "foreach" operating
on $_. Change it to jump to the enclosing loop of any kind (which now
includes "given" blocks).
|
| | |
|
| |
| |
| |
| | |
A "given" construct is now officially a one-iteration loop.
|
| |
| |
| |
| | |
This context frame type doesn't need to cater for "given" any more.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
This enforces that a smartmatch overload returns just a truth value
indicating whether the lhs matches the criterion, not some more complex
kind of result that doesn't fit the smartmatch concept.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Regularise smartmatch's operand handling, by removing the implicit
enreferencement and just supplying scalar context. Eviscerate its runtime
behaviour, by removing all the matching rules other than rhs overloading.
Overload smartmatching in the Regexp package to perform regexp matching.
There are consequential customisations to autodie, in two areas. Firstly,
autodie::exception objects are matchers, but autodie has been advising
smartmatching with the exception on the lhs. This has to change to the
rhs, in both documentation and tests. Secondly, it uses smartmatching as
part of its hint mechanism. Most of the hint examples, in documentation
and tests, have to change to subroutines, to be portable across Perl
versions.
|
| |
| |
| |
| |
| |
| | |
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].
|
| |
| |
| |
| |
| |
| |
| | |
It does not make sense to jump into a ‘given’ any more than it makes
sense to jump into ‘foreach’, which has long been forbidden, since
there is no value to turn into a topic. Up till now this construct
has always crashed.
|
|/
|
|
|
| |
Put it in a static function, instead of repeating the code. This way I
can add more conditions to that code in subsequent commits.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The substitution code was trying to track the taintedness of the
replacement string itself, but it didn't account for the replacement
being an untainted object with overloading that returns a tainted
stringification. It looked at the taintedness of the object value, not
realising that taint could arise during the string concatenation per se.
Change the taint checks to look at the actual TAINT_get flag after string
concatenation. This may falsely ascribe to the replacement taint that
actually came from somewhere else, but the end result is the same anyway:
there's no visible behaviour that distinguishes taint specifically from
the replacement. Also remove a related taint check that seems to be
not needed at all. Fixes [perl #115266].
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There were some problems arising from some warning bitsets being shorter
than others, which happens when registration of a new warning category
makes new bitsets longer. Most obviously, if a scope used "use warnings
'all'" to turn on all warnings and then turned off some specific warnings,
then that scope wouldn't get warnings for subsequently-registered warning
categories, because its bitset doesn't extend to the bit controlling
the new category. (If just "use warnings 'all'" was used, without any
customisation, then a special hack made that work for new categories.)
It was also possible for a longer bitset to get truncated by a warnings
pragma, because the bitset editing code assumed that all bitsets are
the same length.
To fix this, first the warning bits for the "all" category have to change
meaning. Unlike all other warning categories, the bits for "all" used to
be set only when there were no warning categories disabled; disabling any
would also clear the "all" bits. That was supporting the special hack
mentioned above that the all-warnings bitset work for new categories.
This exception is now removed, so the meaning of the "all" bits is now the
more obvious meaning, of indicating the default treatment that the scope
wants for warnings not falling into any category known to the bitset.
In warnings::warnif() et al, if the caller's bitset is found to be too
short to have a bit for the relevant category, then the setting for the
"all" category is used instead.
Because the length of a bitset is an integral number of bytes, but
only two bits are used per category, the length of a bitset doesn't
precisely indicate which categories had been registered by the time it
was constructed. So the standard bitsets for the "all" category are
now always filled to their byte length, with bits set preemptively for
categories not yet registered that fall within the current bitset length.
When a warnings pragma operates on a bitset, it first expands it to the
preferred length, by duplicating the "all" bits for the categories covered
by the new length. It is careful to maintain the length when combining
the bitset with the standard bitsets for categories. When a bitset is
read from ${^WARNING_BITS} or from caller(), the standard pWARN_ALL
setting is no longer expanded by the core to $warnings::Bits{all},
because the core's short WARN_ALLstring will now be expanded correctly
just like any other bitset.
Fixes [perl #108778].
|