| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Commit 22ff313068 for [perl #123814] inadvertently changed the logic when
parsing a numeric parameter to the -C option, such that the successfully
parsed number was not saved as the option value if it parsed to the end
of the argument.
|
| |
|
|
|
|
|
|
| |
This reverts commit d28a9254e445aee7212523d9a7ff62ae0a743fec.
Turns out we need save_re_context() after all
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
An empty cpan/.dir-locals.el stops Emacs using the core defaults for
code imported from CPAN.
Committer's work:
To keep t/porting/cmp_version.t and t/porting/utils.t happy, $VERSION needed
to be incremented in many files, including throughout dist/PathTools.
perldelta entry for module updates.
Add two Emacs control files to MANIFEST; re-sort MANIFEST.
For: RT #124119.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For lots of core functions:
if a function parameter has been declared NN in embed.fnc, don't test for
nullness at the start of the function, i.e. eliminate code like
if (!foo) ...
On debugging builds the test is redundant, as the PERL_ARGS_ASSERT_FOO
at the start of the function will already have croaked.
On optimised builds, it will skip the check (and so be slightly faster),
but if actually passed a null arg, will now crash with a null-deref SEGV
rather than doing whatever the check used to do (e.g. croak, or silently
return and let the caller's code logic to go awry). But hopefully this
should never happen as such instances will already have been detected on
debugging builds.
It also has the advantage of shutting up recent clangs which spew forth
lots of stuff like:
sv.c:6308:10: warning: nonnull parameter 'bigstr' will evaluate to
'true' on first encounter [-Wpointer-bool-conversion]
if (!bigstr)
The only exception was in dump.c, where rather than skipping the null
test, I instead changed the function def in embed.fnc to allow a null arg,
on the basis that dump functions are often used for debugging (where
pointers may unexpectedly become NULL) and it's better there to display
that this item is null than to SEGV.
See the p5p thread starting at 20150224112829.GG28599@iabyn.com.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some questions and loose ends:
XXX gv.c:S_gv_magicalize - why are we using SSize_t for paren?
XXX mg.c:Perl_magic_set - need appopriate error handling for $)
XXX regcomp.c:S_reg - need to check if we do the right thing if parno
was not grokked
Perl_get_debug_opts should probably return something unsigned; not sure
if that's something we can change.
|
|
|
|
|
|
| |
Both needed: the macro is for compilers, the comment for static checkers.
(This doesn't address whether each spot is correct and necessary.)
|
| |
|
|
|
|
|
|
| |
Unfortunately, running out of memory in safesysmalloc() and
safesysrealloc() doesn't produce a catchable croak(), so remove the
test.
|
|
|
|
| |
Extracted from patch submitted by Lajos Veres in RT #123693.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts & amends my v5.21.7-151-gea5519d and Karl Williamson's
v5.21.7-183-g2f3cbe1, the latter was only need because of the
former.
I've also taken the opportunity to fix the long-standing trivial bug
with misaligned code in warnings.{pm,h}. That was easier to commit along
with this than to split it up from the other generated changes.
Why revert this? See the "use warnings 'absolutely-all-almost';" thread
on perl5-porters for the latest summary:
http://www.nntp.perl.org/group/perl.perl5.porters/2015/01/msg225066.html
Basically as I explained in v5.21.7-151-gea5519d the current design of
the API makes it too contentious to freely add new warnings, but there's
no consensus on how to solve that. I.e. whether we should just add them
to "all", or do this change, or several other possible things outlined
in that thread and elsewhere.
Since the deadline for contentious changes for v5.22 is already past us
I'm backing this out for now.
|
|
|
|
|
| |
Otherwise we leak several dozens of megabytes, if not more,
for each Perl_dump_c_backtrace().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When someone suggests a new warning on p5p it always often up being
argued about on the basis that it'll break existing code, and that we
shouldn't add warnings for possibly legitimate code just because it's
unusual or odd.
As I pointed out in a discussion about RT #121025 (see [1]) we only keep
having this discussion because until now we've had no facility to add
new warnings outside of the default set that'll be retroactively enabled
for everything that does 'use warnings'. This patch introduces such a
facility.
As a proof of concept I'm adding a warning for something that was added
as a warning in the past, but pulled out because it was deemed too
controversial at the time: warning about the use of grep in void
context.
That warning was added back in v5.10.0-218-g74295f0 but quickly pulled
out in v5.10.0-230-gf5df478. See [2] for the discussion about it at the
time.
Now if you do:
use warnings;
grep /42/, (1,2);
You'll get no warnings as before, but if you do:
use warnings qw(extra); # Or its sole subcategory: void_unusual
grep /42/, (1,2);
You'll get a warning about "Unusual use of grep in void context". To
turn off this warning once you've turned it on it's *not* sufficient to
do:
no warnings;
You need to do:
no warnings qw(pedantic);
Or:
no warnings qw(everything);
I'm willing to change that, but first we should ask ourselves whether
this should continue to remain a symmetric operation:
{use,no} warnings ['all'];
There's more elaboration on how this works in the changes I'm making to
the perldelta and the warnings documentation. But briefly this should be
100% backwards compatible, but allow us to have our cake and eat it too
in the future by adding new warnings without imposing them on existing
code written against older perl versions (unless that code explicitly
requested to get new warnings as they upgrade perl).
The patch to the warnings.pm documentation lays out a backwards
compatibility policy for warnings, we promise that we'll continue the
status quo with the "all" category, but for other categories (including
future additions) we'll make such promises on a per-category basis.
TODO: I wanted to come up with some more general facility for being able
to add these new warnings without altering the behavior of the -w and -W
switches. I.e. now we'll emit this, as intended:
$ ./perl -Ilib -w -e 'grep /42/, (1,2)'
$ ./perl -Ilib -W -e 'grep /42/, (1,2)'
$ ./perl -Ilib -e 'use warnings; grep /42/, (1,2)'
$ ./perl -Ilib -e 'use warnings "extra"; grep /42/, (1,2)'
Unusual use of grep in void context at -e line 1.
I.e. we don't want -w and -W to mean "use warnings 'everything'", it
should continue to mean "use warnings 'all'". But due to how they're
implemented I couldn't find an easy way to generalize this. Right now
I'm just hardcoding an exception to the new warning category I've added
outside "all" for these warnings.
That should be followed-up with a more general solution, but for now if
we only have a few of these catogeries we should be fine.
This patch incorporates work from Andreas Guðmundsson
<andreasg@nasarde.org> who picked up an earlier version of mine and
figured out the change being made to mg.c here. That change removes an
optimization in the ${^WARNING_BITS} magic which might make things a tad
slower.
1. https://rt.perl.org/Ticket/Display.html?id=121025#txn-1276663
2. http://www.nntp.perl.org/group/perl.perl5.porters/2007/12/msg131922.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The important part of the error message is that the binaries are
mismatched; the details of the handshake keys are an implementation
detail.
Or to put it another way, when someone mixes up their paths, getting
something like
Fcntl.c: Invalid handshake key got 0xcf80000 needed 0xd700000, binaries are mismatched
Is a bit scary and confusing. This is hopefully (slightly) less scary:
Fcntl.c: loadable library and perl binaries are mismatched (got handshake key 0xcf80000, needed 0xd700000)
|
|
|
|
|
|
| |
Clean up the description of this function; in particular, say at the top
what the function is for; fix typos; and generally improve the readability
of the text.
|
|
|
|
|
|
|
|
| |
Since commit db6e00bd00 the function has not been used by XS modules. Now
remove it from export table since it has never been public API (the macro
is), and it saves its symbol name string name, symbol table pointer,
and allows for inlining and/or random calling convention optimization
by the CC.
|
|
|
|
|
|
|
|
|
| |
to match the existing convention (OpREFCNT, OpSLAB).
Dave Mitchell asked me to wait until after his multideref work
was merged.
Unfortunately, there are now CPAN modules using OP_SIBLING.
|
|
|
|
|
|
|
| |
commit 6edcbed640 goto-ed around an initialization and was partially
reverted in commit c62df97fd6 . This patch restores the intention of
commit 6edcbed640 by having only 1 exit path that will be returning
a pointer (and not croaking).
|
|
|
|
| |
In particular, remove all instances of 'assert(0);'.
|
|
|
|
|
| |
util.c: In function ‘I32 Perl_xs_handshake(U32, void*, const char*, ...)’:
util.c:5389:39: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Based on commit 73758d77 (by me), in commit 117af67d629 more things got
noreturn removed on MSVC. See also ML post
"(Hugmeir) Re: [perl.git] branch blead, updated. v5.21.0-377-gdc3bf40"
This caused a measurable increase in machine code size in 117af67d629 .
In commit 73758d77 , the reason there was no increase is
Perl_magic_regdatum_set is called only through a magic vtable. Optimizing
this to noreturn is forbidden unless the struct member type specifies it
(and it obviously doesn't, since this is the magic vtable).
The other not-noreturn on MSVC function, Perl_screaminstr, has no core
usage (its only reference is in the export table) or CPAN grep usage so
therefore it is being removed. It was made fatal in commit 9e3f0d16db .
before .text section of perl521.dll on VC 2003 32b, 0xc66a3 bytes, after
0xc6453
|
|
|
|
|
| |
The gotos were jumping over initializations, causing
C+++threads+debugging to fail.
|
|
|
|
|
|
|
|
|
|
| |
-show intermediate values to make C debugging easier
-Perl_safesysfree overwrote var where with a different value, this caused
alot of confusion for me of trying to hunt for a pointer from a stack
trace with conditional breakpoints, so don't change var where in an
unoptimized build
-in Perl_safesysrealloc and Perl_safesysmalloc provide 1 exit path, so
the returned value is easily seen and BPed on unoptimized builds
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- this improves the error message on ABI incompatibility, per
[perl #123136]
- reduce the number of gv_fetchfile calls in newXS over registering many
XSUBs
- "v" was not stripped from PERL_API_VERSION_STRING since string
"vX.XX.X\0", a typical version number is 8 bytes long, and aligned to
4/8 by most compilers in an image. A double digit maint release is
extremely unlikely.
- newXS_deffile saves on machine code in bootstrap functions by not passing
arg filename
- move newXS to where the rest of the newXS*()s live
- move the "no address" panic closer to the start to get it out of the way
sooner flow wise (it nothing to do with var gv or cv)
- move CvANON_on to not check var name twice
- change die message to use %p, more efficient on 32 ptr/64 IV platforms
see ML post "about commit "util.c: fix comiler warnings""
- vars cv/xs_spp (stack pointer pointer)/xs_interp exist for inspection by
a C debugger in an unoptimized build
|
|
|
|
|
| |
A recent commit gave some warnings about format types,
and assignments without extra parens within an if condition.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This API elevates the amount of ABI compatibility protection between XS
modules and the interp. It also makes each boot XSUB smaller in machine
code by removing function calls and factoring out code into the new
Perl_xs_handshake and Perl_xs_epilog functions.
sv.c :
- revise padlist duping code to reduce code bloat/asserts on DEBUGGING
ext/DynaLoader/dlutils.c :
- disable version checking so interp startup is faster, ABI mismatches are
impossible because DynaLoader is never available as a shared library
ext/XS-APItest/XSUB-redefined-macros.xs :
- "" means dont check the version, so switch to " " to make the test in
xsub_h.t pass, see ML thread "XS_APIVERSION_BOOTCHECK and XS_VERSION
is CPP defined but "", mow what?"
ext/re/re.xs :
- disable API version checking until #123007 is resolved
ParseXS/Utilities.pm :
109-standard_XS_defs.t :
- remove context from S_croak_xs_usage similar to core commit cb077ed296 .
CvGV doesn't need a context until 5.21.4 and commit ae77754ae2 and
by then core's croak_xs_uage API has been long available and this
backport doesn't need to account for newer perls
- fix test where lack of having PERL_IMPLICIT_CONTEXT caused it to fail
|
|
|
|
|
|
|
| |
We control both strings. Perl API versions are not old decimal or alphas
versions. Maints dont increase Perl API ver. Just do a memcmp. Faster and
less machine code. Before 0xA6 bytes of machine code on VC 2003 32b,
after 0x35. This patch is related to [perl #123136].
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
$ PERL5DB='sub DB::DB{}' ./perl -Ilib -XMfeature=:all -de '
state sub f{};
sub DB::goto { warn $DB::sub }
$^P|=0x80;
sub {goto &f}->()'
main::f at -e line 1.
There should not be a package name. Lexical subs should be treated
like anonymous subs here; $DB::sub should contain a reference.
This bug was introduced recently, in ae77754ae. Before that the
output was:
CODE(0x7fdbf102de58) at -e line 1.
Though before 9d8e4b9b3 it was:
Segmentation fault: 11
|
|
|
|
|
| |
This macro, intended for internal use, simplifies the code in
a couple of places.
|
|
|
|
| |
It is an empty function.
|
| |
|
|
|
|
|
|
|
|
| |
This is a followup to 07ad9e0e19891ec129e1a78e40a66ca19b51302d.
util.c:Perl_my_setenv() unconditionally used setenv() if #defined(__sun).
Solaris 8 had neither setenv() nor unsetenv(), so it failed. Configure
does not currently check for setenv(), but the check for unsetenv()
is sufficient here since Solaris 9 and later have both.
|
| |
|
|
|
|
|
| |
Remaining atoi() uses include at least:
ext/DynaLoader/dl_aix.xs, os2/os2.c, vms/vms.c
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove (almost all) direct access to the op_sibling field of OP structs,
and use these three new macros instead:
OP_SIBLING(o);
OP_HAS_SIBLING(o);
OP_SIBLING_set(o, new_value);
OP_HAS_SIBLING is intended to be a slightly more efficient version of
OP_SIBLING when only boolean context is needed.
For now these three macros are just defined in the obvious way:
#define OP_SIBLING(o) (0 + (o)->op_sibling)
#define OP_HAS_SIBLING(o) (cBOOL((o)->op_sibling))
#define OP_SIBLING_set(o, sib) ((o)->op_sibling = (sib))
but abstracting them out will allow us shortly to make the last pointer in
an op_sibling chain point back to the parent rather than being null, with
a new flag indicating whether this is the last op.
Perl_ck_fun() still has a couple of direct uses of op_sibling, since it
takes the field's address, which is not covered by these macros.
|
|
|
|
|
|
|
|
| |
You need to configure with g++ *and* -Accflags=-DPERL_GLOBAL_STRUCT
or -Accflags=-DPERL_GLOBAL_STRUCT_PRIVATE to see any difference.
(g++ does not do the "post-annotation" form of "unused".)
The version code has some of these issues, reported upstream.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Removing context params will save machine code in the callers of these
functions, and 1 ptr of stack space. Some of these funcs are heavily used
as mg_find*. The contexts can always be readded in the future the same way
they were removed. This patch inspired by commit dc3bf40570. Also remove
PERL_UNUSED_CONTEXT when its not needed. See removal candidate rejection
rational in [perl #122106].
-Perl_hv_backreferences_p uses context in S_hv_auxinit
commit 96a5add60f was wrong
-Perl_whichsig_sv and Perl_whichsig_pv wrongly used PERL_UNUSED_CONTEXT
from inception in commit 84c7b88cca
-in authors opinion cast_* shouldn't be public API, no CPAN grep usage,
can't be static and/or inline optimized since it is exported
-Perl_my_unexec move to block where it is needed, make Win32 block, context
free, for inlining likelyhood, private api and only 2 callers in core
-Perl_my_dirfd make all blocks context free, then change proto
-Perl_bytes_cmp_utf8 wrongly used PERL_UNUSED_CONTEXT
from inception in commit fed3ba5d6b
|
| |
|
| |
|
|
|
|
|
|
| |
This reverts commit 148f39b7de6eae9ddd59e0b0aff691d6abea7aca.
(Still needs more work, but wanted to see how well this passed with Jenkins.)
|
|
|
|
|
|
| |
Definitely not *after* it. It marks the start of the unreachable,
not the first unrechable line. And if they are in that order,
it looks better to linebreak after the lint hint.
|
|
|
|
|
|
|
|
| |
This meant sprinkling some PERL_UNUSED_CONTEXT invocations,
as well as stopping some functions from getting my_perl in
the first place; all of the functions in the latter category
are internal (S_ prefix and s or i in embed.fnc), so
this should be both safe and economical.
|
| |
|
|
|
|
|
| |
Namely, die_nocontext, die, die_sv, and screaminstr. They
all croak and never return, so let's mark them as non-returning.
|
|
|
|
| |
This silences a chunk of warnings under -Wformat
|