summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Allow :isa in class declaration without a blockArne Johannessen2023-03-027-931/+954
| | | | | | | | | Using class attributes in the unit class syntax was a syntax error. This change makes the following two lines equivalent: class B :isa(A) ; class B :isa(A) { } Addresses GH issue #20888.
* dist/Thread-Queue - add missing build artifactsYves Orton2023-03-027-2/+308
| | | | | | Add Changes, Makefile.PL and examples directory. Fixes this module for https://github.com/Perl/perl5/issues/20874
* cpan/Config-Perl-V - update to 0.36Yves Orton2023-03-0230-40/+257
|
* Fixup for sync-with-cpan - deal with .tgz filesYves Orton2023-03-021-3/+9
| | | | | | We were only handling '.tar.gz' files, but Config::Perl::V uses '.tgz' so when we ran the sync script got very confused and deleted everything and then tried to add the raw archive.
* dist/Thread-Semaphore - add missing build artifactsYves Orton2023-03-026-2/+127
| | | | | | Adds Changes, Makefile.PL, and examples/semaphore.pl Fixes this module for https://github.com/Perl/perl5/issues/20874
* dist/SelfLoader - Update missing build artifactsYves Orton2023-03-024-0/+65
| | | | | | Fixes https://github.com/Perl/perl5/issues/20874 for this module Tweaked Makefile.PL to set the license to 'perl_5' and not 'perl'
* dist/Math-Complex - add missing files from CPAN distYves Orton2023-03-025-5/+553
| | | | | | This fixes this module for https://github.com/Perl/perl5/issues/20874 Tweaked Makefile.PL to set the LICENSE to 'perl_5' and not 'perl'
* Attribute-Handlers: add Makefile.PLGraham Knop2023-03-023-0/+26
| | | | | | | | | | | | | Add a Makefile.PL for Attribute-Handlers in core so that it can be maintained properly. This avoids the need for an external repo to maintain these extra files. Taken from Attribute-Handlers-0.99, with the following modifications: - install in site, not perl - Fix license, and don't try to handle ancient perl or EUMM versions - update metadata URLs - no indexing demo directory
* dist/Test - add missing build artifactsYves Orton2023-03-024-0/+194
| | | | | | | | Fixes this module for https://github.com/Perl/perl5/issues/20874 Note the Makefile.PL was tweaked a bit to install into the right place depending on version, and with an added comment. There are some very old perls listed here.
* dist/I18N-LangTags - Add Makefile.PL from CPANYves Orton2023-03-023-1/+30
| | | | | | | For some reason the CPAN module is not properly indexed. It is https://metacpan.org/release/SBURKE/I18N-LangTags-0.35. This fixes this module for https://github.com/Perl/perl5/issues/20874
* dist/Net-Ping - add missing build artifactsYves Orton2023-03-024-0/+112
| | | | | | | | Files copied from https://github.com/rurban/Net-Ping with minor changes made to point at the perl5 repo as we are upstream, also changed the INSTALLDIRS rule to make the other files. This fixes the module for https://github.com/Perl/perl5/issues/20874
* dist/Tie-File - add missing build artifactsYves Orton2023-03-023-0/+35
| | | | Fixes https://github.com/Perl/perl5/issues/20874 for this module
* Inline get_context() for non-Win32Karl Williamson2023-03-015-37/+52
| | | | | | | This trivial function should get optimized out. But I couldn't get it to work for Windows, because the two likely hdr files don't have PL_thr_key defined in them. I suppose a new hdr file could be created that gets included later. But I didn't think it was worth it.
* Inline get_vtbl()Karl Williamson2023-03-014-16/+15
| | | | This trivial function will likely get optimized out
* embed.fnc: Mark some inline functions as suchKarl Williamson2023-03-012-37/+37
| | | | | | I had thought that the 's' flag was sufficient for making a function inline. But because of PERL_NO_INLINE_FUNCTIONS, the 'i' flag is also needed.
* POSIX.pod: Remove obsolete C89 referenceKarl Williamson2023-03-011-1/+1
|
* POSIX.xs: Silence compiler warningKarl Williamson2023-03-012-6/+3
| | | | | | | | | This happens only in the unlikely event that localeconv() isn't present on the system. There are two ways used in this file to announce the lack of system. This commit converts to the other way than previously, and the warning goes away.
* eval_sv(): improve code commentDavid Mitchell2023-03-011-1/+8
| | | | | | | Explain in detail why the return arg on the stack from the eval can't be NULL on successful compilation. (Spotted by Hugo)
* bump $Math::{Complex,Trig}::VERSIONTony Cook2023-03-012-2/+2
|
* Math::Trig: make the great_circle_midpoint() example more complete積丹尼 Dan Jacobson2023-03-011-1/+3
| | | | | Yes, "or about 69 N 89 E, in the frozen wastes of Siberia." but must reveal the crucial missing step involved!
* Perl_deb_stack_all() - handle empty CX stackDavid Mitchell2023-02-281-1/+4
| | | | | | | | | | | | | | | | | This function handles perl -Dsv, producing output like STACK 0: MAIN CX 0: BLOCK => CX 1: SUB => UNDEF PV("main"\0) retop=leave STACK 1: MAGIC CX 0: SUB => IV(1) When a CX stack had zero contexts pushed (like can sometimes happen when something has just done a PUSHSTACKi() and no op has pushed a BLOCK or SUB or whatever yet), then the code for determining where the next markstack pointer is (by peeking ahead into the first CX of the next SI) was accessing random garbage at cx[0]. This commit fixes that.
* ext/XS-APItest/t/magic.t: simplify recent testDavid Mitchell2023-02-281-8/+13
| | | | | | | | | | | A test recently added to check reference count of a stored AV element had to account for extra reference counts from the temporary refs generated by if (\$a[0] == \$j) { ... } Instead, calculate this boolean value in a separate statement so the ref counts are easier to understand.
* XS::APItest::test_EXTEND(): fixupsDavid Mitchell2023-02-281-6/+14
| | | | | | | | | | | | | | | | | | | This XS function is for testing the stack-extending EXTEND() macro. This commit fixes two issues. 1) it uses a nested 'sp' variable declaration in addition to the one declared implicitly, which is confusing. Use a separate variable called new_sp instead. This changes the logic slightly, since the EXTEND() macro messes implicitly with sp, including updating it after a realloc. We have to do that manually now with new_sp. 2) The test function NULLs a couple of items near the top of the (potentially just extended) stack. Where the extend size is zero, it could be NULLing out one or two of the passed arguments on the stack. At the moment these values aren't used any more and are discarded on return; but it will get messy once the stack becomes reference-counted, so only NULL addresses if they're above PL_stack_sp.
* eval_sv(): call pp_entereval() via runopsDavid Mitchell2023-02-285-91/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like the previous commit which did it for amagic_call() and call_sv(), this commit makes executing the faked-up OP_ENTEREVAL be executed as part of the runops loop rather than as a separate call. This is to allow shortly fixing up for a reference-counted stack. (CALLRUNOPS() will reify the stack if necessary, while the raw call to pp_entereval() won't fix up the stack unless its part of the runops loop too.) However, this is a bit more complex than call_sv() etc in that there is a good reason for calling pp_entereval() separately. The faked up OP_ENTEREVAL has its op_next set to NULL - this is the op which would normally be returned on failure of the eval compilation. By seeing whether the retuned value from pp_entereval() is NULL or not, eval_sv() can tell whether compilation failed. On the other hand, if pp_entereval() was made to be called as part of the runops loop, then the runops loop *always* finishes with PL_op set to NULL. So we can no lo longer distinguish between compile-failed and compile-succeeded-and-eval-ran-to-completion. This commit moves the entereval into the runops loop, but restores the ability to distinguish in a slightly hacky way. It adds a new private flag for OP_ENTEREVAL - OPpEVAL_EVALSV - which indicates to pp_entereval() that it was called from eval_sv(). And of course eval_sv() sets this flag on the OPpEVAL_EVALSV op it fakes up. If pp_entereval() fails to compile, then if that flag is set, it pushes a null pointer onto the argument stack before returning. Thus by checking whether *PL_stack_sp is NULL or not on return from CALLRUNOPS(), eval_sv() regains the ability to distinguish the two cases.
* call_sv, amagic_call: call pp_entersub via runopsDavid Mitchell2023-02-282-17/+10
| | | | | | | | | | | | | | | | | | | | | | | These two functions do a slightly odd thing (which has been present since 5.000) when calling out to a CV: they half fake up an OP_ENTERSUB, then call pp_entersub() directly, and only then if it returns a non-null PL_op value, execute the rest of the ops of the sub within a CALLRUNOPS() loop. I can't find any particular reason for this. I guess it might make calling XS subs infinitesimally faster by not have to invoke the runops loop when only a single op is executed (the entersub), but hardly seems worth the effort. Conversely, eliminating this special-case makes the code cleaner, and it will allow the workarounds planned to be added shortly (to the runops loops for reference-counted stacks) to work uniformly. Without this commit, pp_entersub() would get called before runops() has had a chance to fix up the stack if necessary. So this commit *fully* populates the fake OP_ENTERSUB (including type and pp address) then causes pp_entersub to be invoked implicitly from the runops loop rather than explicitly.
* move test out of fresh_perl.t into sub.tDavid Mitchell2023-02-282-14/+11
| | | | | | | This test looks for a 'Use of freed value in iteration' warning, which will soon disappear when this branch makes the stack reference counted. Make the test more modifiable so that it can be made conditional on build options.
* pp_sort(): rename a duplicated variableDavid Mitchell2023-02-281-2/+2
| | | | | | 'av' is in scope both for the whole function, and for a small block within that function. Rename the inner variable to av0 to avoid confusion.
* pp_sort(): add comments what the op flags meanDavid Mitchell2023-02-281-0/+18
|
* rationalise S_unwind_loop()David Mitchell2023-02-281-12/+20
| | | | | | | | | | | | This function is a bit of mess. It gets the label string either from the op, or for OPf_STACKED, from the SV at the top of the stack. This commit reduces the amount of OPf_STACKED tests and repeated stack accesses for the label SV (even after it's notionally been popped off the stack!) By simplifying the code, it will also make it easier to make the changes necessary for a reference-counted stack.
* add code comments concerning grep and map markstack usageDavid Mitchell2023-02-282-0/+112
|
* for loops: protect GV/LVREF from premature freeDavid Mitchell2023-02-283-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In something like for $package_var (....) { ... } or more experimentally, for \$lvref (....) { ... } when entering the loop in pp_enteriter, perl would pop the GV/LVREF off the stack, but didn't bump its refcount. Thus it was possible (if unlikely) that it could be freed during the loop. In particular this crashed: $f = "foo"; for ${*$f} (1,2) { delete $main::{$f}; # delete the glob *foo ...; } This will become more serious when the stack becomes refcounted, as popping something off the stack will trigger a refcount decrement on it and thus a possible immediate free of the GV. This commit future-proofs for loops against this by ensuring that the refcount of the SV referred to by cx->blk_loop.itervar_u.svp is appropriately bumped up / down on entering / exiting the loop.
* simplify scope-exit empty scalar contextDavid Mitchell2023-02-281-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Perl_leave_adjust_stacks(), which is called by all the scope-exiting ops (pp_leave, pp_leavesub etc), handles scalar context by updating the list of SVs on the stack to be returned to be just the one-item list at the top of the stack (all other items on the stack being discarded). For the special case of scalar context and no items on the return list, it instead puts &PL_sv_undef at the lowest point on the stack and skips most of the rest of the function. The rest of the function includes things like shuffling down any args to be returned, which obliterates any other stuff on that stack that needs discarding. For example in for (qw(a b c)) { ....; return qw(x y z); ... } the stack contains a b c x y z; the a,b,c need discarding and the x,y,z shifting down. This commit removes the 'skip rest' special behaviour, and makes scalar return of an empty list behave the same as a scalar return of a non-empty list. So it pushes &PL_sv_undef at the top of the stack, then goes through the normal "shift and copy the top arg down the stack" code path. This is slightly less efficient, but this is relatively rare condition, and will make converting Perl_leave_adjust_stacks() to handle a reference-counted stack easier.
* don't call pp_pushmark() to push a markDavid Mitchell2023-02-282-5/+4
| | | | | A few places were calling pp_pushmark(), when they should have been just directly doing a PUSHMARK()
* NULL sv->sv_debug_file when freedDavid Mitchell2023-02-281-1/+4
| | | | | | | | This field is used on DEBUG_LEAKING_SCALARS builds to track the file where the SV was allocated. When freeing the SV, the string was freed but the pointer was left pointing at the freed string. So NULL it out.
* fix check order for filetest overloadDavid Mitchell2023-02-281-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tryAMAGICftest_MG() macro was doing two checks: 1) seeing whether the filetest operator's arg (*PL_stack_sp) looks to have magic or be a reference, 2) and if the op has children (which will have pushed an arg, unlike (-X _), If both are true, then do full-on magic and/or overload processing. The problem with this is that it checks the arg *before* checking whether there's even an arg. Thus in the case of (-X _), it is actually examining a random SV on the stack (or in the case of nothing on the stack, examining the PL_sv_undef pointer always stored at PL_stack_base[0] as a guard.) It turns out this was harmless - the test for (1) will examine a random (but real) SV and get garbage results, but then the 2nd test will fail anyway, so overloading won't be called. So the fix is to swap the (1) and (2) test order. In addition, I changed the 'has an argument' test from OPf_KIDS to !OPf_REF. These should be mutually exclusive, but the OPf_REF flag formally indicates (-X _), i.e. that no arg has been pushed on the stack. Whether the op has children or not could potentially change in the future, independent of whether it's the (-X _) form. So overall this commit makes no visible functional difference, but may make the code more robust against future changes.
* perl -DsR: display PADMTPs as <P>David Mitchell2023-02-281-1/+3
| | | | | | | | | | | | | The R modifier to the stack debugging switch -Ds already indicates if an SV's refcount is > 1 or SvTEMP is set (T), or the SV is on the temps stack without SvTEMP set (t), e.g.: => IV(101), <2>IV(102), <T>IV(103) <3t>IV(104) With this commit, it displays SVs with the SvPADTMP flag set as <P>, e.g. => <P>IV(101), <2P>IV(102), <PT>IV(103)
* cpan/Digest-SHA - sync to 6.04Yves Orton2023-02-267-31/+28
| | | | Updated to build without warnings on gcc-12.
* Add recent CVf_ flags to Devel::Peek::Dump outputDavid Mitchell2023-02-261-1/+6
|
* utf8.h: Rmv improper (STRLEN) castKarl Williamson2023-02-261-1/+1
| | | | | | | | An enum is supposed to be an int. STRLEN may be too large for that. (I suspect the cast was inadvertently left in converting from an earlier implementation that was never released.) Spotted by H. Merijn Brand.
* dist/Time-HiRes - silence ppport warningYves Orton2023-02-262-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Silences the following warning: In file included from HiRes.xs:23: ./ppport.h:14832:1: warning: unused function 'DPPP_my_ck_warner' [-Wunused-function] DPPP_(my_ck_warner)(pTHX_ U32 err, const char *pat, ...) ^ ./ppport.h:11568:21: note: expanded from macro 'DPPP_' #define DPPP_(name) DPPP_CAT2(DPPP_NAMESPACE, name) ^ ./ppport.h:11567:24: note: expanded from macro 'DPPP_CAT2' #define DPPP_CAT2(x,y) CAT2(x,y) ^ ../../config.h:1387:19: note: expanded from macro 'CAT2' #define CAT2(a,b) PeRl_CaTiFy(a,b) ^ ../../config.h:1385:27: note: expanded from macro 'PeRl_CaTiFy' #define PeRl_CaTiFy(a, b) a ## b ^ <scratch space>:34:1: note: expanded from here DPPP_my_ck_warner ^ 1 warning generated.
* APITest.xs - silence build warning under 32 bit clangYves Orton2023-02-262-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Silence build warning with 32 bit build under clang. Also bump version. APItest.xs:7614:24: warning: format specifies type 'unsigned int' but the argument has type 'U32' (aka 'unsigned long') [-Wformat] i, hash32, vectors_32[i]); ^~~~~~ ../../fakesdio.h:64:50: note: expanded from macro 'printf' #define printf(fmt,args...) PerlIO_stdoutf(fmt,##args) ~~~ ^~~~ APItest.xs:7614:32: warning: format specifies type 'unsigned int' but the argument has type 'U32' (aka 'unsigned long') [-Wformat] i, hash32, vectors_32[i]); ^~~~~~~~~~~~~ ../../fakesdio.h:64:50: note: expanded from macro 'printf' #define printf(fmt,args...) PerlIO_stdoutf(fmt,##args) ~~~ ^~~~ APItest.xs:7835:24: warning: format specifies type 'unsigned int' but the argument has type 'U32' (aka 'unsigned long') [-Wformat] i, hash32, vectors_32[i]); ^~~~~~ ../../fakesdio.h:64:50: note: expanded from macro 'printf' #define printf(fmt,args...) PerlIO_stdoutf(fmt,##args) ~~~ ^~~~ APItest.xs:7835:32: warning: format specifies type 'unsigned int' but the argument has type 'U32' (aka 'unsigned long') [-Wformat] i, hash32, vectors_32[i]); ^~~~~~~~~~~~~ ../../fakesdio.h:64:50: note: expanded from macro 'printf' #define printf(fmt,args...) PerlIO_stdoutf(fmt,##args) ~~~ ^~~~ 4 warnings generated.
* regcomp.c - remove unused debug logic that warns under clang.Yves Orton2023-02-261-4/+0
| | | | | | | | | | | | | | | | | | And by removing it we silence the following build warning: regcomp.c:2285:28: warning: format specifies type 'int' but the argument has type 'I32' (aka 'long') [-Wformat] parno, RExC_parno_to_logical[parno], RExC_parno_to_logical_next[parno]); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./regcomp_internal.h:212:37: note: expanded from macro 'RExC_parno_to_logical' #define RExC_parno_to_logical (pRExC_state->parno_to_logical) ^ regcomp.c:2285:58: warning: format specifies type 'int' but the argument has type 'I32' (aka 'long') [-Wformat] parno, RExC_parno_to_logical[parno], RExC_parno_to_logical_next[parno]); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./regcomp_internal.h:213:37: note: expanded from macro 'RExC_parno_to_logical_next' #define RExC_parno_to_logical_next (pRExC_state->parno_to_logical_next) ^ 2 warnings generated.
* dump.c - cast sprintf args properly to silence build warning under clangYves Orton2023-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | Silence the following warnings: dump.c:2688:25: warning: format specifies type 'long long' but the argument has type 'ssize_t' (aka 'int') [-Wformat] r->offs[n].start, r->offs[n].end, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./embed.h:831:72: note: expanded from macro 'sv_catpvf' # define sv_catpvf(a,...) Perl_sv_catpvf(aTHX_ a,__VA_ARGS__) ^~~~~~~~~~~ dump.c:2688:43: warning: format specifies type 'long long' but the argument has type 'ssize_t' (aka 'int') [-Wformat] r->offs[n].start, r->offs[n].end, ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ ./embed.h:831:72: note: expanded from macro 'sv_catpvf' # define sv_catpvf(a,...) Perl_sv_catpvf(aTHX_ a,__VA_ARGS__) ^~~~~~~~~~~ 2 warnings generated.
* class.c - silence build warning under clangYves Orton2023-02-261-2/+2
| | | | | | | | | | | | | | | Use SSize_t for iterator as it matches the type being compared against. Silences the following warning: class.c:555:26: warning: comparison of integers of different signs: 'U32' (aka 'unsigned long') and 'long' [-Wsign-compare] for(U32 i = 0; i <= AvFILL(superaux->xhv_class_adjust_blocks); i++) ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class.c:699:40: warning: comparison of integers of different signs: 'U32' (aka 'unsigned long') and 'ssize_t' (aka 'int') [-Wsign-compare] for(U32 i = 0; fieldnames && i <= PadnamelistMAX(fieldnames); i++) { ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 warnings generated.
* dist/Storable - fix build warning from ppport.h inclusionYves Orton2023-02-262-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Silence warning about PL_parser. As far as I can tell we do not use it. In file included from ../../perl.h:28, from Storable.xs:16: ppport.h:11564:26: warning: ‘DPPP_dummy_PL_parser’ defined but not used [-Wunused-variable] 11564 | # define DPPP_NAMESPACE DPPP_ | ^~~~~ ../../config.h:1385:27: note: in definition of macro ‘PeRl_CaTiFy’ 1385 | #define PeRl_CaTiFy(a, b) a ## b | ^ ppport.h:11567:24: note: in expansion of macro ‘CAT2’ 11567 | #define DPPP_CAT2(x,y) CAT2(x,y) | ^~~~ ppport.h:11568:21: note: in expansion of macro ‘DPPP_CAT2’ 11568 | #define DPPP_(name) DPPP_CAT2(DPPP_NAMESPACE, name) | ^~~~~~~~~ ppport.h:11568:31: note: in expansion of macro ‘DPPP_NAMESPACE’ 11568 | #define DPPP_(name) DPPP_CAT2(DPPP_NAMESPACE, name) | ^~~~~~~~~~~~~~ ppport.h:12222:18: note: in expansion of macro ‘DPPP_’ 12222 | static yy_parser DPPP_(dummy_PL_parser); | ^~~~~
* Compile class.c on VMSCraig A. Berry2023-02-251-2/+2
| | | | Otherwise its symbols are missing at link time.
* Bump $VERSION in lib/feature.pm to 1.81.James E Keenan2023-02-242-2/+2
| | | | | Change is actually made in regen/feature.pl, then we run 'perl regen.pl'.
* Update the smartmatch experiment statusPhilippe Bruhat (BooK)2023-02-251-1/+5
|
* Document that smartmatch is deprecated and will be removed in 5.42Philippe Bruhat (BooK)2023-02-253-16/+20
|
* Smartmatch deprecation warnings are disabled by `no warnings 'deprecated'`Philippe Bruhat (BooK)2023-02-251-2/+0
|