| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The short story: In 5.13.1 or .2 these ops started calling get-magic
just once if the same gmagical scalar was used for both operands. Then
the same value would be used on both sides. In 5.12 FETCH would be
called twice with both return values used, but they would be swapped
in most cases (so $t/$t would return 1.5 if $t returned 2 and then
3). Now FETCH is called twice and the two operands are used in the
right order.
Up till now there have been patches to fix specific ops, but I real-
ised that the same ten or so lines of code would have to be added to
the rest of the 20+ pp_ functions, all of which use tryAMAGICbin_MG
(which calls Perl_try_amagic_bin in gv.c), so it made sense to add the
code to Perl_try_amagic_bin instead. This fixes all the ops in one
fell swoop.
The code in question checks whether the left and right operands are
the same gmagical scalar. If so, it copies the scalar into a new mor-
tal one, and then calls get-magic on the original operand to get its
new value (for the rhs). The new scalar is placed just below the top
of the stack, so it becomes the left operand.
This does slow down the bitwise integer ops slightly, but only in this
rare edge case. And the simplification of the code seems worth it.
Forthcoming are commits that revert some of the changes already made,
as this commit renders them unnecessary.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is only part of #87708.
This fixes the + operator outside of any ‘use integer’ scope when the
same tied scalar is used for both operands and returns two different
values. Before this commit, get-magic would be called only once and
the same value used. In 5.12.x it just worked.
I tried modifying pp_eq throughout to take this case into account,
but it made the most common cases slightly slower, presumably because
of the extra checks. So this follows the same temp sv method that I
used for pp_add (in 4c3ac4b and 837c879), which, though slowing down
this edge cases due to the extra allocation, leaves the most common
cases just as fast. (And, in case my benchmarks were unreliably [not
unlikely], this method is also safer, as it has less chance of getting
different code paths wrong.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PerlIO layer types have this property that flags if they can accept
multiple arguments or only one. Unfortunately, this always checks the
uppermost layer that has an Open method defined. This causes issues when
used with utf8 or bytes on top of a layer that uses multiple arguments.
For 5.15 I think abolishing this feature may make most sense. It's just
flat out wrong IMO, it's the layer that uses the arguments that should
validate them, not the topmost, which may not even touch them. In the
mean time adding the multiargs flag to :utf8 and :bytes is a reasonable
stop-gap.
This patch makes perl slightly more permissive, so it shouldn't break
any working code out there.
|
|
|
|
|
|
|
|
|
|
| |
A statement should have been outside a block but was inside it.
The indentation was correct, and in a number of times reading
the code I still missed it.
I'm having trouble distilling down the failure scenario into
a simple test case, and am short on tuits right now, so a test
will be committed later.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As mention in the ticket, this was caused by b4dd662, which removed
‘dead’ code from gv_stashpvn:
commit b4dd66232df8f0d1c00796970dec7fc37fbe9edf
Author: Nicholas Clark <nick@ccl4.org>
Date: Fri Oct 8 21:33:29 2010 +0100
Remove dead code from Perl_gv_stashpvn().
GvHV() and HvNAME() will both always already be set, as gv_fetchpvn_flags()
will initialise these as it walks the string in its initial loop to locate the
correct stash, then return early because name == name_end.
This code has been dead since it was added in 5.000.
--- a/gv.c
+++ b/gv.c
@@ -927,11 +927,9 @@ Perl_gv_stashpvn(pTHX_ const char *name, U32 namelen, I32 flags)
Safefree(tmpbuf);
if (!tmpgv)
return NULL;
- if (!GvHV(tmpgv))
- GvHV(tmpgv) = newHV();
stash = GvHV(tmpgv);
- if (!HvNAME_get(stash))
- hv_name_set(stash, name, namelen, 0);
+ assert(stash);
+ assert(HvNAME_get(stash));
return stash;
}
This routine, before the snippet shown, adds two colons to the end of
the name and then passes "main::::" to gv_fetch_pvn_flags.
gv_fetch_pvn_flags, when it parses a "::", sets the next subname to
point to the character after the second colon, and then continues
scanning from the next character *after* that. So foo::::bar becomes
$foo::{"::bar"} and main:::: becomes $main::{"::"}.
The code that assigns the name to the stash and the early exit are
both inside an if(we have a package separator) block, but the final ::
is not considered one, so a nameless hash is returned.
The easiest way to fix this is to revert just the changes to
lines that deal with the name (since the other deleted lines are
really dead).
|
|
|
|
|
|
|
| |
Allocating an extra SV for rare edge cases...er...only needs to be
done in those rare edge cases.
Uninitialized warnings are only supposed to be enabled when they are.
|
|
|
|
|
|
|
|
|
| |
This is just part of #87708.
This fixes the + operator outside of any ‘use integer’ when the same
tied scalar is used for both operands and returns two different val-
ues. Before this commit, get-magic would be called only once and the
same value used. In 5.12.x it worked.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The functions S_save_magic() and S_restore_magic(), which are called by
mg_get(), mg_set(), mg_length(), mg_size() and mg_clear(),
are not robust when called with an SV whose reference count is zero.
Basically, one of the actions of S_save_magic() is to temporarily
increase the refcount of the SV, and then for S_restore_magic() to reduce
it again at the end, so that if any of the magic functions called
inbetween decrease the count, it won't be prematurely freed.
However, if the count starts at zero, then bumping it up and bringing it
back down to zero, triggers a spurious second freeing.
So, if its zero, just skip the whole bumping thing.
Now, we shouldn't really be calling these functions will a zero-refcount
SV, but these things happen, and its best to be robust.
In particular, this fixes RT #87860, which was ultimately triggered by a
bug in Set::Object 1.28 that managed to create an HV with null SvMAGIC
field, but with the RMG flag set.
When freeing that HV, sv_clear() skips doing mg_free() because SvMAGIC is
null, whereas later it calls Perl_hv_undef_flags, which calls mg_clear()
because it uses the test SvRMAGICAL(hv) (which is true).
|
|
|
|
|
|
|
|
|
| |
This is just part of #87708.
This fixes the / operator under ‘use integer’ when the same tied sca-
lar is used for both operands and returns two different values. Before
this commit, get-magic would be called only once and the same value
used. In 5.12.x the operands were swapped.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is just part of #87708.
This fixes the % and * operators under ‘use integer’ when the same
tied scalar is used for both operands and returns two different val-
ues. Before this commit, get-magic would be called only once and
the same value used. In 5.12.x * just worked but the operands were
swapped for %.
It turns out that every operator using the dPOPTOPiirl_nomg macro
needs exactly the same treatment, so this commit eliminates the
dPOPTOPiirl_halfmg macro added a few commits ago and modifies
dPOPTOPiirl_nomg to do was it was doing. This should be perfectly
safe, as dPOPTOPiirl_nomg has not been in a stable release (and is
only for internal use anyway).
|
|
|
|
|
|
|
|
|
| |
This is just part of #87708.
This fixes + and - under ‘use integer’ when the same tied scalar is
used for both operands and returns two different values. Before this
commit, get-magic would be called only once and the same value used.
In 5.12.x + just worked but the operands were swapped for -.
|
|
|
|
|
|
|
|
|
| |
This is just part of #87708.
This fixes < under ‘use integer’ when the same tied scalar is used for
both operands and returns two different values. Before this commit,
get-magic would be called only once and the same value used. In 5.12.x
the operands were swapped.
|
|
|
|
|
|
|
|
|
| |
This is just part of #87708.
This fixes > under ‘use integer’ when the same tied scalar is used for
both operands and returns two different values. Before this commit,
get-magic would be called only once and the same value used. In 5.12.x
the operands were swapped.
|
|
|
|
|
|
|
|
|
| |
This is just part of #87708.
This fixes <= under ‘use integer’ when the same tied scalar is used
for both operands and returns two different values. Before this com-
mit, get-magic would be called only once and the same value used. In
5.12.x the operands were swapped.
|
|
|
|
|
|
|
|
|
| |
This is just part of #87708.
This fixes >= under ‘use integer’ when the same tied scalar is used
for both operands and returns two different values. Before this com-
mit, get-magic would be called only once and the same value used. In
5.12.x the operands were swapped.
|
|
|
|
|
|
|
|
|
| |
This is just part of #87708.
This fixes == under ‘use integer’ when the same tied scalar is used
for both operands and returns two different values. Before this com-
mit, get-magic would be called only once and the same value used. In
5.12.x it just worked.
|
|
|
|
|
|
|
|
|
| |
This is just part of #87708.
This fixes != under ‘use integer’ when the same tied scalar is used
for both operands and returns two different values. Before this com-
mit, get-magic would be called only once and the same value used. In
5.12.x it just worked.
|
|
|
|
|
|
|
|
|
|
| |
A missing '!' turned \W into \w in some code execution paths and utf8 data.
This patch fixes that.
It does not include tests at the moment, since I don't have time
just now to examine why the existing tests didn't catch this, when
it looks like they are set up to, and there have been several BBC tickets
lately that I'm hopeful this may fix and head off other ones.
|
|
|
|
|
|
|
|
|
| |
This is just part of #87708.
This fixes <=> under ‘use integer’ when the same tied scalar is used
for both operands and returns two different values. Before this com-
mit, get-magic would be called only once and the same value used. In
5.12.x, the operands would be reversed.
|
| |
|
|
|
|
|
|
|
| |
This fixes atan2 when the same tied scalar is used for both operands
and returns two different values. Before this commit, get-magic would
be called only once and the same value used. In 5.12.x, the operands
would be reversed.
|
|
|
|
| |
It turns out to be an extra semicolon
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Previously -no-cpp-precomp was added uncondtionally to cppflags and ccflags.
Apple's compiler accepts this unconditionally. gcc 4.5 warns about it, but
ignores it. gcc 4.6 treats the unknown flag as an error. Hence test whether
the flag causes problems, and only add it if it does not.
(Searching with Google suggests that this flag has been unnecessary on OS X
for some time. However, there's no clear documentation about it to confirm
when it stopped being necessary.)
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This reverts commit e713b73750eb9e684a6d14dcca1a22d55ce2226d.
See [perl #87704].
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On VMS only, the /DEFINE and /INCLUDE qualifiers are parsed off the
local copy of $Config{ccflags} and consumed in the process. This is
necessary because you're only allowed one of each of these clauses
in the compile command, so to add whatever has been requested for a
specific compile, we have to combine them with whatever Perl was
built with.
But since they are consumed, multiple compiles on the same EU::CB
object were only using the correct flags for the first one. Even
calling the have_compiler() check before compile() would make the
latter miss the defines and includes that were used to build Perl.
The solution is add a platform override that resets the local copy
of $Config{ccflags} from its original in %Config every time a
compiler operation is initiated.
Fixes smoke failures in ExtUtils::ParseXS.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit stops CV anonymisation from autovivifying stashes to point
to (unless the stash is %__ANON__::).
If a stash has been deleted from its original position in the symbol
table, then its HvNAME will no longer indicate where to find it.
S_anonymise_cv_maybe in sv.c was using the HvNAME to look up (and
autovivify) the *__ANON__ glob in the stash, without taking into
account that it might not actually be looking in the right spot.
So now, after checking that the stash still has a name (HvNAME), it
uses the HvENAME to find it. If the HvENAME is null, which indicates
that the stash has been detached altogether, then %__ANON__:: is used,
as happens when HvNAME is null.
This solves a Class::Monadic failure introduced by commit 2d0d1eccfc
([perl #79208] %stash:: = () anonymises CVs), which was included
in 5.13.7.
Basically, it can be reduced to this:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this commit:
commit f07ec6dd59215a56bc1159449a9631be7a02a94d
Author: Zefram <zefram@fysh.org>
Date: Wed Oct 13 19:05:19 2010 +0100
remove filter inheritance option from lex_start
The only uses of lex_start that had the new_filter parameter false,
to make the new lexer context share source filters with the previous
lexer context, were uses with rsfp null, which therefore never invoked
source filters. Inheriting source filters from a logically unrelated
file seems like a silly idea anyway.
string evals could inherit the same source filter space as the cur-
rently compiling code. Despite what the quoted commit message says,
sharing source filters allows filters to be inherited in both direc-
tions: A source filter created when the eval is being compiled also
applies to the file with which it is sharing its space.
There are at least 20 CPAN distributions relying on this behaviour
(or, rather, what could be considered a Test::More bug). So this com-
mit restores the source-filter-sharing capability. It does not change
the current API or make public the API for sharing source filters, as
this is supposed to be a temporary stop-gap measure for 5.14.
|
| |
|
|
|
|
| |
bumping the perl version
|
|
|
|
|
|
|
|
|
|
| |
the auto-regen magic isn't doing the right thing for uperl. We should
either be skipping the regen check on it or we should be automating it.
t/porting/regen.t failed without this change.
We should also consider making bump-perl-version NOT operate on any
generated files and mandate a rerun after bumping versions
|
| |
|
| |
|
|
|
|
| |
CPAN modules
|
|
|
|
| |
I misread a commit message. I should have tried it out. :-)
|
|
|
|
| |
This is wrong, and doesn't belong in an introductory document
|
|
|
|
| |
This is for consistency with other pods
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
HTTP::Tiny 0.011 fails to mirror files correctly on MSWin32, preventing
CPAN bootstrapping over HTTP with just core Perl. This is fixed in CPAN
version 0.012.
[DELTA]
0.012 2011-03-31 15:48:02 America/New_York
[BUG FIXES]
- mirror() now uses binmode during output (RT #67118) [Serguei Trouchelle]
[DOCUMENTATION]
- noted that SSL certificates are not verified against CA's
(RT #66907)
|
| |
|
|
|
|
|
| |
perlretut still says /o is needed to prevent regex re-compilation in
loops.
|
|
|
|
|
|
|
| |
blocks are mostly useless, and not suitable for an introduction
to regular expressions. It was not always the case, as in very early
Unicode these were the best approximation to the much more useful
Script concept. But that changed 10 or so years ago.
|
| |
|
| |
|