| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Some of the HV logic uses a negative key length to indicate utf8
keys, and this logic was using an unsigned keylength, which obviously
does not work
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The leading underbar is reserved by C.
These defines are debugging only "recursion" depth related counters
injected into the function macro wrappers when a function is marked as
'W', much the same way that aTHX_ and pTHX_ are when building under
threaded builds. The functions are expected to incremented the depth
parameter themselves. Note that "recursion" is quoted above because in
practice currently they are only used by the regex engine when recursing
virtually, and they do not relate to true C stack related recursion.
(But they could be used for tracking C level recursion under debugging
if someone needed it.)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GCC-12 seems to have a propensity to warning about maybe-uninitialized
variables a lot more than it should. Most of the cases I have looked
into it turns out to be a false positive, but at the same time, it is
pretty simple to fix this kind of thing, so just fix it so the darn
thing will shut up.
This one just initializes some variables to NULL at the start of a test
function.
Fixes the following (slightly elided) warning.
gcc-12 -c ... -Og -g ... -W -Wall RealPPPort.c
In file included from ../../perl.h:6197,
from RealPPPort.xs:31:
../../embed.h: In function ‘XS_Devel__PPPort_OpSIBLING_tests’:
../../embed.h:461:49:
warning: ‘lastkid’ may be used uninitialized [-Wmaybe-uninitialized]
461 | # define op_free(a)
Perl_op_free(aTHX_ a)
^~~~~~~~~~~~
RealPPPort.xs:1741:21: note: ‘lastkid’ was declared here
1741 | OP *lastkid;
| ^~~~~~~
Fixes Github Issue #20816
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since 7169efc77525df70484a824bff4ceebd1fafc760, perl's core STMT_START
and STMT_END macros no longer try to use brace groups, due to the
warnings they can generate and their very limited usefulness.
That commit also changed Devel::PPPort to remove the use of brace groups
in STMT_START/STMT_END. That led to errors in older perls, so it was
partly reverted in e08ee3cb66f362c4901846a46014cfdfcd60326c. Since then,
various other macros have been improved to properly work with brace
groups enabled or disabled.
We can now remove the brace group using variant of STMT_START/STMT_END,
which will silence the warnings from clang.
|
|
|
|
|
|
|
|
|
|
| |
The macro for croak_sv when brace groups are not enabled uses
STMT_START/STMT_END. This works when used as a statement, but would
break if used as part of an expression.
To resolve this, change that macro to use a function. As a static inline
function with a namespaced name, it shouldn't cause problems with
namespace pollution.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is really easy to get confused about the difference between
NEXTOPER() and regnext() of a regnode. The two concepts are related,
similar, but importantly distinct. NEXTOPER() is also defined in such a
way that it is easy to abuse and misunderstand and encourages producing
code that is fragile to larger change, effectively "baking in"
assumptions to the code that are difficult to discover by searching.
Changing the type and storage requirements of a regnode may break things
in subtle and hard to debug ways.
An example of how NEXTOPER() is problematic is that this:
NEXTOPER(NEXTOPER(branch)) does not mean "find the second node after the
branch node", it means "jump forward by a regnode which happens to be
two regnodes large". In other words NEXTOPER is just a fancy way of
writing "node+1".
This patch replaces NEXTOPER() with three new macros:
REGNODE_AFTER_dynamic(node)
REGNODE_AFTER_opcode(node,op)
REGNODE_AFTER_type(node,tregnode_OPNAME)
The first is the most generic case, it jumps forward by the size of the
node, and determines that size by consulting OP(node). The second is
where you have already extracted OP(node), and the third is where you
know the actual structure that you want to jump forward by. Every
regnode type has a corresponding type, which is known at compile time,
so using the third will produce the most efficient code. However in many
cases the code operates on one of several types, whose size may be the
same now, but may change in the future, in which case one of the other
forms is preferred. The run time logic in regexec.c should probably
only use the REGNODE_AFTER_type() interface.
Note that there is also a REGNODE_BEFORE() which replaces PREVOPER(),
which is used in a specific piece of legacy logic but should not be
used otherwise. It is not safe to go backwards from an arbitrary node,
we simply have no way to know how large the previous node is and thus
where it starts.
This patch includes some logic that validates assumptions during DEBUG
mode which should catch errors from resizing regnodes.
After this patch changing the size of an existing regnode should be
relatively safe and errors related to sizing should trigger assertion
fails.
This patch includes changes to perlreguts.pod to explain this stuff
better.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes up 6d66b125bb339b62c0d8d4283d3fe576795764ce so that the
Devel::PPPort portion works on all supported Perls.
Basically, we have to preserve the pre-existing behavior for all Perls
that still have VOIDFLAGS, which was removed by:
Author: Nicholas Clark nick@ccl4.org
Date: Wed Sep 11 11:54:42 2013 +0200
Eliminate the only use of VOIDFLAGS, as part of STMT_START in perl.h
STMT_START has used VOIDFLAGS as part of its conditional compilation
since it was added by commit 728e280 (March 1996). The code originally
read:
/* Now which other defined()s do we need here ??? */
Since then it has been amended to avoid entering that definition for GCC
on Solaris. Given that all current Solaris compilers are C89 conformant,
VOIDFLAGS will always be true (actually 15), so the test is redundant.
Even back in 1996, it's possible that VOIDFLAGS was always non-zero on
SunOS, rendering the test obsolete from the start.
Spotted by Brian Fraser, and extracted from a larger patch of his.
|
| |
|
|
|
|
|
|
|
| |
This reverts the portion of commit
6d66b125bb339b62c0d8d4283d3fe576795764ce that modified Devel::PPPort.
It turns out that it broke that module when the module is run on Perl
5.13.0 (and presumably any earlier Perl).
|
|
|
|
|
|
|
|
|
|
| |
This warns (and warns a lot) on clang, and since these are documented
to only work to make a single statement, so there's little value to
allowing them to work in an expression.
An alternative would be to disable GCC brace groups on clang, but
these are used extensively in DEBUGGING builds to add extra checks
in sv.h.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Apply patch already applied to Dual-Life/Devel-PPPort:
https://github.com/Dual-Life/Devel-PPPort/pull/196.patch
This is matching what's done in ExtUtils::ParseXS::Utilities
and avoids need to redefine croak_xs_usage later.
For: https://github.com/Perl/perl5/issues/18040
|
| |
|
|
|
|
|
|
| |
This is mainly restoring the PERL_BCDVERSION macro.
PERL_BCDVERSION is used by multiple CPAN distributions
and should not have been renamed.
|
|
|
|
|
| |
Note that test files are not under file version
control anymore as they are generated files.
|
|
|
|
|
|
|
|
|
| |
These changes from Devel-PPPort are adding
support for Perl 7.0 and fixes the testsuite
with a Perl 7.0.0 binary.
We would have to publish a new version of
Devel-PPPort.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[DELTA]
3.57 - 2020-01-31
* Fix eval_sv for Perl versions prior to 5.6.0 (Pali)
* Fix t/ppphtest.t for Perl versions prior to 5.6.0 (Pali)
* Fix compilation of sv_setsv_flags when GCC extensions are not present (Pali)
* Fix SV_NOSTEAL on 5.7.2 (Karl Williamson)
* Fix multiple unit test issues (Craig A. Berry, Karl Williamson, Pali)
* Avoid generating warnings on early Perls (Karl Williamson)
* Backport memCHRs (Karl Williamson)
* Implement sv_setsv_flags() with SV_NOSTEAL and SV_GMAGIC flags for Perl versions < 5.7.3 (Pali)
* Implement UTF8f format and its UTF8fARG macro (Pali)
|
| |
|
| |
|
| |
|
|
|
|
|
| |
It turns out that there was special code added in the 5.20 maint series
that needed to be accounted for.
|
| |
|
|
|
|
|
|
|
|
| |
There are some ok() that need to remain so, but this converts all the
ones that are really is() to be that.
After this commit, the remaining ok() can have a test description added
to them.
|
|
|
|
|
| |
The new skip() has a count of tests. Previously you had to loop
yourself.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit copies much of test.pl from blead to replace the Test ones.
These versions are much friendlier to use. Several .t files required
minor changes to work with these. pv_tools.t was the only file using
the old obsolete skip() functionality fully. The new version does not
do a 'last SKIP', for compatibility.
like and unlike were not ported because of the absence of qr// in perls
this is supposed to work on.
And the portions of test.pl that were copied also required a few minor
changes to work back to 5.3.7.
Not all the ported functionality is currently in used. It may be that
changes will have to be made to it to get it to work; or will have to be
deleted.
|
|
|
|
|
|
|
|
|
| |
This seems to happen only when Devel::PPPort was built with
Visual C++ and nmake as a standalone distribution.
perl/perl5@1ddd2f5fcd8802a45ffd773aec3af107f37613f6 had fixed that
before, but the change was made only in the autogenerated test file
and it was discarded when the tests were regenerated.
|
|
|
|
| |
This fixes compilation with Visual C++
|
|
|
|
|
|
|
|
|
| |
Doing this showed me a redundant test.
I didn't have to take out the zeros, it just looks better without them.
(cherry picked from commit 9e0e078a1aefa78df3322c87b01323862e05c397)
Signed-off-by: Nicolas R <atoomic@cpan.org>
|
|
|
|
|
| |
(cherry picked from commit bb54da9a565f7fcf13708a69ed6a33a36bb32745)
Signed-off-by: Nicolas R <atoomic@cpan.org>
|
|
|
|
|
| |
(cherry picked from commit 3df9d356984187e51559b28cd6653cfffef94bff)
Signed-off-by: Nicolas R <atoomic@cpan.org>
|
|
|
|
|
|
|
|
| |
When input UTF-8 is 13 bytes, return 13, even on 32 bit machines where
overflow happens at 7 UTF-8 bytes.
(cherry picked from commit f379e2ee4277fc855a37b82c6c94294c4e0e8c8d)
Signed-off-by: Nicolas R <atoomic@cpan.org>
|
|
|
|
|
| |
(cherry picked from commit 237f5af008eeb7e48fa94eb14952cc1f37d7807e)
Signed-off-by: Nicolas R <atoomic@cpan.org>
|
|
|
|
|
|
|
|
| |
I'm not sure why I think this is a good idea, but I know Unicode
handling started in 5.6, and am converting to use that criterium
(cherry picked from commit d69dce5eb7ab3ae39718aad250fcba2189773621)
Signed-off-by: Nicolas R <atoomic@cpan.org>
|
|
|
|
|
|
|
| |
This also involves some test refactoring
(cherry picked from commit 7149d3266cce3561c90c73f57ec932db73105311)
Signed-off-by: Nicolas R <atoomic@cpan.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A few of this class of macros did not go back very far. This makes a
reasonable attempt to get things right, but very early versions may have
some wrong answers, but unlikely.
This was complicated by the fact that isascii() and isblank() may not be
available on a given platform. So this just uses the plain non-locale
version for those very early Perl versions.
I didn't add tests. It is hard to portably test locales. The next
commits will backport functions that call these and do have tests.
(cherry picked from commit a8f88b13766d8f2820f5bba560bb282188124b34)
Signed-off-by: Nicolas R <atoomic@cpan.org>
|
|
|
|
|
|
|
| |
Mostly indenting a newly formed block
(cherry picked from commit 820b22a12ec9783c819b7f2400201908bceed04d)
Signed-off-by: Nicolas R <atoomic@cpan.org>
|
|
|
|
|
|
|
|
| |
The result of this commit is a loop that runs once; that will change in
two commits from now, when it runs with different values
(cherry picked from commit 1d9bacdd128c8dc51c3b54b05e9d112a39c25e4a)
Signed-off-by: Nicolas R <atoomic@cpan.org>
|
|
|
|
|
| |
(cherry picked from commit 1123d46ee9d608669383de3bf540882072690ad4)
Signed-off-by: Nicolas R <atoomic@cpan.org>
|
|
|
|
|
| |
(cherry picked from commit 9ae426cf5b257cb458fcf48427524a6aa4332cad)
Signed-off-by: Nicolas R <atoomic@cpan.org>
|
|
|
|
|
|
|
|
| |
This is to distinguish it from a macro with similar intent about to be
added.
(cherry picked from commit cd875ece2bd9cf79a62016767589f8b5821293d6)
Signed-off-by: Nicolas R <atoomic@cpan.org>
|
|
|
|
|
|
|
|
| |
On early perls, there was no distinction between fold and lowercase, so
just call lower from fold.
(cherry picked from commit 0450a74631276c933399241c46616508ce32c299)
Signed-off-by: Nicolas R <atoomic@cpan.org>
|
|
|
|
|
|
|
|
|
| |
This converts the testing of certain tests that are nearly identical to
use a loop with a hash to store the differences, leading to simpler,
extensible code.
(cherry picked from commit 14ec6258920f199e95c72891c23139f6ff10e511)
Signed-off-by: Nicolas R <atoomic@cpan.org>
|
|
|
|
|
|
|
| |
This constant was wrong in earlier perls.
(cherry picked from commit 6e55485b5c4486d7883a50325a42a51dcca42ab8)
Signed-off-by: Nicolas R <atoomic@cpan.org>
|
|
|
|
|
|
|
| |
We were double xlating the underscore
(cherry picked from commit dc1ee4fcc8bc4d1f627c33228ab30432e57f0a9a)
Signed-off-by: Nicolas R <atoomic@cpan.org>
|
|
|
|
|
| |
(cherry picked from commit eddcc8663f05c54bedd22e22242d751af34e61d3)
Signed-off-by: Nicolas R <atoomic@cpan.org>
|