| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
| |
There are a number of object methods which make absolutely
no sense when called as class methods. In addition, with
Perl 5.11.5/5.12.0, there are asserts which will trigger
SEGV's when you do that.
So we check in the XS code and refuse to continue if an
object method is called as a class method.
|
|
|
|
|
| |
This reduces object code size, reducing CPU cache pressure on the non-exception
paths.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A number of function names that do warnings have been added, but diag.t
hasn't kept up.
This patch changes it to look for likely function names in embed.fnc, so
it will automatically keep up in the future. There's no need to worry
about it looking for inappropriate functions, as the syntax of messages
that it looks for is so restrictive, that there won't be false
positives. Instead there are still many messages it fails to catch.
As a result of it's falling behind several issues have crept in. I
resolved the couple I thought were clear (including one in a comment;
diag.t doesn't strip comments, but mostly it doesn't matter), and added
the others to the <DATA> section to ignore.
are
|
|
|
|
| |
The array should be declared with its actual size.
|
| |
|
|
|
|
|
| |
Replacing the longhand list of calls to newXS{,proto} with loop over a data
structure reduces the object size by over 1K.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Authors: John Peacock, David Golden and Zefram
The goal of this mega-patch is to enforce strict rules for version
numbers provided to 'package NAME VERSION' while formalizing the prior,
lax rules used for version object creation. Parsing for use() is
unchanged.
version.pm adds two globals, $STRICT and $LAX, containing regular
expressions that define the rules. There are two additional functions
-- version::is_strict and version::is_lax -- that test an argument
against these rules.
However, parsing of strings that might contain version numbers is done
in core via the Perl_scan_version function, which may be called during
compilation or may be called later when version objects are created by
Perl_new_version or Perl_upg_version.
A new helper function, Perl_prescan_version, has been added to validate
a string under either strict or lax rules. This is used in toke.c for
'package NAME VERSION' in strict mode and by Perl_scan_version in lax
mode. It matches the behavior of the verison.pm regular expressions,
but does not use them directly.
A new test file, comp/packagev.t, validates strict and lax behaviors of
'package NAME VERSION' and 'version->new(VERSION)' respectively and
verifies their behavior against the $STRICT and $LAX regular
expressions, as well. Validating these two implementation should help
ensure they each work as intended.
Other files and tests have been modified as necessary to support these
changes.
There is remaining work to be done in a few areas:
* documenting all changes in behavior and new functions
* determining proper treatment of "," as decimal separators in
various locales
* updating diagnostics for new error messages
* porting changes back to the version.pm distribution on CPAN,
including pure-Perl versions
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
A constant subroutine is now optimised away at DESTROY time.
|
|
|
|
|
| |
The function Internals::inc_sub_generation() was removed
in commit 41892db1963e88b547da12808d8e5630cc1edb59
|
| |
|
|
|
|
|
| |
never been in a released version of perl, so this change has no compatibility
implications.
|
|
|
|
| |
S_mro_get_linear_isa_dfs(), we can move get_isa_hash() to any other source file.
|
|
|
|
|
|
| |
Message-ID: <25940.1225611819@chthon>
Date: Sun, 02 Nov 2008 01:43:39 -0600
p4raw-id: //depot/perl@34698
|
|
|
|
|
|
| |
This is mostly to silence gcc's warning, "format not a string
literal and no format arguments".
p4raw-id: //depot/perl@34694
|
|
|
|
|
|
| |
Can't easily do gv.h, as GvGP() (at least) needs to split into two
macros - one const for reading, one non-const for writing.
p4raw-id: //depot/perl@34679
|
|
|
|
|
| |
Perl_sv_magicext(), which is documented.
p4raw-id: //depot/perl@34671
|
|
|
| |
p4raw-id: //depot/perl@34653
|