| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"version" was being treated as a version object and then failing
the validation check. It should be treated as a string, just like
"versions":
$ perl5.15.4 -Ilib -e '$^V < "version"'
Invalid version object at -e line 1.
$ perl5.15.4 -Ilib -e '$^V < "versions"'
Invalid version format (dotted-decimal versions require at least three parts) at -e line 1.
See also perl #102586.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was treating it as a version object and then failing the validation
test, instead of treating it as an invalid version format, as it does
with "versions":
$ ./perl -Ilib -e'$VERSION = "versions"; main->VERSION(1)'
Invalid version format (dotted-decimal versions require at least three parts) at -e line 1.
$ ./perl -Ilib -e'$VERSION = "version"; main->VERSION(1)'
Invalid version object at -e line 1.
See also perl #102586.
|
| |
|
|
|
|
|
|
| |
Previously setting a large (negative in 32-bit signed) reference count
would be returned as a positive number on 64-bit builds and negative
on 32-bit builds.
|
| |
|
|
|
|
| |
This avoids creating a lot of temporary SVs.
|
| |
|
| |
|
| |
|
|
|
|
| |
plus other tweaks
|
|
|
|
|
| |
This adds _sv, _pv, and _pvn forms to sv_does, and changes it to use
sv_ref() instead of sv_reftype().
|
| |
|
|
|
|
|
|
|
| |
This makes them both nul-and-UTF8 clean, although the latter
is somewhat superficial, as mro isn't clean yet.
(Tests coming once ->can and ->DOES are clean)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See the thread starting at:
http://www.nntp.perl.org/group/perl.perl5.porters/2011/07/msg175161.html
Instead of assuming that only Perl subs have mallocked CvFILEs and
only under threads, resulting in various hackery to borrow parts of
the SvPVX buffer where that assumption proves wrong, we can simply
add another flag (DYNFILE) to indicate whether CvFILE is mallocked,
instead of trying to use the ISXSUB flag for two purposes.
This simplifies the code greatly, eliminating bug #96126 in the pro-
cess (which had to do with sv_dup not knowing about the hackery that
this commit removes).
I removed that comment from cv_ckproto_len about CONSTSUBs doubling up
the buffer field, as it is no longer relevant. But I still left the
code as it is, since it’s better to do an explicit length check.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this patch:
$ ./miniperl -le ' $VERSION = "3alpha"; print "main"->VERSION'
3alpha
$ ./miniperl -le ' $VERSION = "3alpha"; print "main"->VERSION(4)'
Invalid version format (non-numeric data) at -e line 1.
See the discussion starting at:
http://www.nntp.perl.org/group/perl.perl5.porters/2011/06/msg173710.html
Basically, this patch allows custom version parsers to call ->VERSION
to retrieve the version, even if the default parser would choke on it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(aka: More fun with Hash::Util)
$ perl -lMHash::Util=lock_value
$h{a} = __PACKAGE__; lock_value %h, a; $h{a} = "3"; print $h{a}'
^D
3
OK, so it didn’t really lock it. Now for more fun:
$ perl -lMHash::Util=unlock_value
$h{a} = __PACKAGE__; unlock_value %h, a; $h{a} =~ y/ia/ao/;
print __PACKAGE__
^D
moan
There are three different ways to fix this:
1) Add an SvFAKE function to Internals:: (not *more* ‘internals’ for
people [ahem, Const::Fast, ahem] to abuse!)
2) Use B::* functions in Hash::Util to check the flags (too slow)
3) Make Internals::SvREADONLY less ‘internal’, by having it deal with
readonliness in general, rather than just the SVf_READONLY flag.
The third approach seems the most logical, so that’s what this
commit does.
There is one test in t/op/tr.t that uses Internals::SvREADONLY to
detect bovinity, so I’ve changed it to use B instead, as that will
have no effect on post-install efficiency.
(This approach also fixes Const::Fast’s bugginess, but that is purely
accidental.)
|
|
|
|
|
| |
boolSV returns an immortal. When sv_2mortal is called on
an immortal, it simply returns. So eliminate the call.
|
|
|
|
|
|
| |
I reverted the first version of this patch because I put the if()
statement before a declaration. I did a revert, rather than a correc-
tion, to make back-porting easier.
|
|
|
|
| |
This reverts commit 40f11004fb3b5fa1cd207a20090df837d721b736.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
utf8::decode was not respecting copy-on-write, but simply modify-
ing the PV (the scalar’s string buffer) in place, causing problems
with hashes:
my $name = "\x{c3}\x{b3}";
my ($k1) = keys %{ { $name=>undef } };
my $k2 = $name;
utf8::decode($k1);
utf8::decode($k2);
print "k1 eq k2 = '", $k1 eq $k2, "'\n";
my $h = { $k1 => 1, $k2 => 2 };
print "{k1} '", $h->{$k1}, "'\n";
print "{k2} '", $h->{$k2}, "'\n";
This example (from the RT ticket) shows that there were two hash ele-
ments with the same key.
As of this commit, the hash only has one element.
|
|
|
|
| |
At XS(XS_UNIVERSAL_DOES), invocant is spelled wrong.
|
|
|
|
|
|
|
|
|
| |
This patch changes the core functions to use the common names for the
fields that are shared between op.c and regcomp.c, just for consistency
of using one name throughout the core for the same thing.
A grep of cpan shows that both names are used in various modules; so
both names must be retained.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The /d, /l, and /u regex modifiers are mutually exclusive. This patch
changes the field that stores the character set to use more than one bit
with an enum determining which one. This data structure more
closely follows the semantics of their being mutually exclusive, and
conserves bits as well, and is better expandable.
A small API is added to set and query the bit field.
This patch is not .xs source backwards compatible. A handful of cpan
programs are affected.
|
|
|
|
|
|
|
|
|
| |
# New Ticket Created by (Peter J. Acklam)
# Please include the string: [perl #81904]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=81904 >
Signed-off-by: Abigail <abigail@abigail.be>
|
|
|
|
| |
It no longer serves much purpose, as of 7311f41d6.
|
|
|
|
|
|
|
|
| |
This is so that it can be used for PL_isarev bookkeeping as well.
This will have no effect on the speed of DFS classes. C3 classes on
which ->isa is never called will have a slight slowdown. (We could
always add an API for setting meta->isa if we want to avoid that.)
|
| |
|
|
|
|
| |
Now all the support code for %+ and %- is contained in the module in ext/
|
| |
|
|
|
|
| |
Initially move only Tie::Hash::NamedCapture::flags from universal.c to it.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This reveals even more similarity between the routines' bodies.
|
|
|
|
|
| |
This may also fix bugs for the (untested) cases where the called routine
returns NULL, and the calling routine attempted XSRETURN_UNDEF.
|
|
|
|
| |
The $flags argument is actually the object, so should not be mentioned.
|
|
|
|
|
|
| |
The calling convention for CALLREG_NAMED_BUFF_*() is to return NULL, or a
reference to a scalar. For CLEAR and STORE we return no values, so if we're
erroneously passed a reference, we should free it to stop it being leaked.
|
|
|
|
|
|
|
|
| |
This may also fix bugs for the (untested) cases where CALLREG_NAMED_BUFF_*
returned NULL, and the calling routine attempted XSRETURN_UNDEF.
It's fine to call sv_2mortal() on the immortals returned by
CALLREG_NAMED_BUFF_EXISTS()
|
|
|
|
|
|
|
|
| |
The core's regexp implementation will always croak, but other pluggable engines
may have read/write semantics, and hence return from their delete call.
Note that STORE and EXISTS are called in void context, hence their return stack
is discarded.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, it would return undef instead of calling Perl_croak_no_modify() if
PL_localizing was true. However, that case can never be reached. PL_localizing
is set non-zero for
1: Perl_mg_localize and PL_save_scalar, for the duration of executing the local
2: Perl_leave_scope for the duration of unwinding the local
However, XS_Tie_Hash_NamedCapture_STORE can't be reached in either case, with
PL_curpm NULL (or otherwise invalid) || !SvROK(ST(0)).
Case 1 would be the call to save_helem_flags() in pp_helem. However, this is
only reached if preeminent is TRUE, which will only hold if hv_exists_ent()
has already returned TRUE, which will only be possible if PL_curpm and ST(0)
are valid.
Case 2 would be the case SAVEt_HELEM in Perl_leave_scope(). However, this
case is only reached as part of the unwinding from Case 1 above, so again
PL_curpm and ST(0) will be valid, for this dynamic scope.
This commit is the patch proposed in RT ##77610. It does not resolve all issues
in that ticket.
Currently C<local $1> is legal - it's a runtime no-op, which neither errors
*nor* resets $1 to undef. Clearly C<local $+{k}> is inconsistent with this,
(as it errors at scope exit for all cases, and additionally errors at local
time if $+{k} exists) but I consider it not worth fixing until we decide
whether C<local $1>'s current behaviour is a "bug" or a "feature".
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds recognition of these modifiers, with appropriate action
for d and l. u does nothing useful yet. This allows for the
interpolation of a regex into another one without losing the character
set semantics that it was compiled with, as for the first time, the
semantics is now specified in the stringification as one of these
modifiers.
To this end, it allocates an unused bit in the structures. The off-
sets change so as to not disturb other bits.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's was intended as a temporary namespace only, and we really don't want to
ship it in any release until we've figured out what it should really look like.
This reverts commit 05c0d6bbe3ec5cc9af99d105b8648ad02ed7cc95,
"add sv_reftype_len() and make sv_reftype() be a wrapper for it"
commit 792477b9c2e4c75cb03d07bd6d25dc7e1fdf448e,
"create the "mauve" temporary namespace for things like reftype"
commit 8df6b97c1de8326d50ac9c8cae4bf716393b45bb,
"mauve.t needs access to %Config, make sure it's available"
commit cfe9162d0d593cd12a979c73df82c7509b324343,
"use more efficient sv_reftype_len() interface"
and commit 47b13905e23c2a72acdde8bb4669e25e5eaefec4
"add more tests to lib/mauve.t so it tests also that mauve::reftype can return "LVALUE""
There's a `mauve' branch still containing all the code for the temporary mauve
namespace. That should be used to work on it until it's mostly ready to be
released, and only then merged to blead. Alternatively, it should be deleted if
another way to provide mauve's features in the core is found.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the &Internals::* functions that use references in their
prototypes to check if the argument is SvROK() before calling SvRV().
If the function is called as Internals::FOO() perl does this check for
us, but prototypes are bypassed on &Internals::FOO() so we still have
to check this manually.
This fixes [perl #77776], this bug was present in 5.10.x, 5.12.x, and
probably all earlier perl versions that had these functions, but I
haven't tested that.
I'm adding a new test file (t/lib/universal.t) to test universal.c
functions as part of this patch. The testing for Internal::* in t/ was
and is very sparse, but before universal.t there was no obvious place
to put these tests.
Signed-off-by: Ævar Arnfjörð Bjarmason <avar@cpan.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Scalar::Util::reftype(), refaddr() and blessed() are all a bit
less useful than they could be as they all return C<undef> when
their argument is not a reference. While this is logical, it also
means that using these routines has to be guarded, and normally
guarded in such a way that the internal logic is called twice.
Additionally these routines are quite commonly used and having to
load an additional DLL and XS code every program is inefficient.
Therefore we introduce the "mauve" namespace for to hold the "fixed"
equivalents, this namespace is /always/ loaded (like the 're' or 'utf8'
namespaces), and thus these routines can be accessed easily at any time.
We also provide a new module wrapper in t/lib which allows these
routines to be exported into other namespaces if the user so chooses.
At Jesse's request I have included weaken() and as it seemed logical to
do so I have also added isweak().
Once we have a good name for the namespace we can s/mauve/whatever/g
|
| |
|