| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Since multi is a boolean (even though it’s typed as an int), there is
no need to have a separate parameter. We can just use a flag bit.
|
| |
|
|
|
|
|
|
|
|
| |
method is a boolean flag (typed I32, but used as a boolean) added by
commit 54310121b442.
These new gv_autoload_* functions have a flags parameter, so there’s
no reason for this extra effective bool. We can just use a flag bit.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The 4 was added in commit 54310121b442 (inseparable changes during
5.003/4 developement), presumably the ‘Don't look up &AUTOLOAD in @ISA
when calling plain function’ part.
Before that, gv_autoload had three arguments, so the 4 indicated the
new version (with the method argument).
Since these new functions don’t all have four arguments, and since
they have a new naming convention, there is not reason for the 4.
|
| |
|
|
|
|
|
|
| |
In addition from taking a flags parameter, it also takes the
length of the method; This will eventually make method
lookup nul-clean.
|
| |
|
|
|
|
|
| |
For macros that returns flags, the _get convention implies that there
could be a _set variant some day. But we don’t do that for flags.
|
|
|
|
|
| |
I'm probably pushing this too early. Can't do the
Perl-level tests because of that. TODO.
|
|
|
|
|
|
|
|
|
| |
gv_init_pvn() is the same as the old gv_init(), but takes
a flags parameter, which will be used for the UTF-8 cleanup.
The old gv_init() is now implemeneted as a macro in gv.h.
Also included is some minimal testing in XS::APItest.
|
|
|
|
| |
Groundwork for the following commits.
|
|
|
|
|
|
|
|
|
|
|
| |
There are so many cases that use this incantation to get around
gv_fetchsv’s calling of get-magic--
STRLEN len;
const char *name = SvPV_nomg_const(sv,len);
gv = gv_fetchpvn_flags(name, len, flags | SvUTF8(sv), type);
--that it’s about time we had a shorthand.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This resolves perl bug #97978.
Many built-in variables, like $], are actually created on the fly
when first accessed. Perl likes to pretend that these variables have
always existed, so it autovivifies the *] glob even in rvalue context
(e.g., defined *{"]"}, close "]").
The list of variables that were autovivified was maintained separ-
ately (in is_gv_magical_sv) from the code that actually creates
them (gv_fetchpvn_flags). ‘Maintained’ is not actually precise: it
*wasn’t* being maintained, and there were new variables that never
got added to is_gv_magical_sv and one deleted variable that was
never removed.
There are only two pieces of code that call is_gv_magical_sv, both in
pp.c: S_rv2gv (called by *{} and also the implicit *{} that functions
like close() provide) and Perl_softrefxv (called by ${}, @{}, %{}).
In both cases, the glob is immediately autovivified if
is_gv_magical_sv returns true.
So this commit eliminates the extra maintenance burden by extirpat-
ing is_gv_magical_sv altogether, and replacing it with a new flag to
gv_fetchpvn_flags, GvADDMG, which will autovivify a glob *if* it’s a
magical one.
It does make defined(*{"frobbly"}) slightly slower, in that it creates
a temporary glob and then frees it when it sees nothing magical has
been done with it. But this case is rare enough it should not matter.
At least I got rid of the bugginess.
|
|
|
|
|
| |
This reverts commit 7c7df8124bbdd7a0091f8ed82589548c8182f624,
except for the perldiag entry, which we still need for splain’s sake.
|
|
|
|
|
|
|
|
| |
and make GvCV() and GvGP() rvalue-only.
This it to allow a future commit to eliminate some backref magic between
GV and CVs, which will require complete control over assignment to the
gp_cv slot.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This test from t/op/gv.t was added by change 22315/4ce457a6:
{
# test the assignment of a GLOB to an LVALUE
my $e = '';
local $SIG{__DIE__} = sub { $e = $_[0] };
my $v;
sub f { $_[0] = 0; $_[0] = "a"; $_[0] = *DATA }
f($v);
is ($v, '*main::DATA');
my $x = <$v>;
is ($x, "perl\n");
}
That change was the one that made glob-to-lvalue assignment work to
begin with. But this test passes in perl version *prior* to that
change.
This patch fixes the test and adds tests to make sure what is assigned
is actually a glob, and not just a string.
It also happens to fix the stringification bug. In doing so, it essen-
tially ‘enables’ globs-as-PVLVs.
It turns out that many different parts of the perl source don’t fully
take this into account, so this patch also fixes the following to work
with them (I tried to make these into separate patches, but they are
so intertwined it just got too complicated):
• GvIO(gv) to make readline and other I/O ops work.
• Autovivification of glob slots.
• tie *$pvlv
• *$pvlv = undef, *$pvlv = $number, *$pvlv = $ref
• Duplicating a filehandle accessed through a PVLV glob when the
stringified form of the glob cannot be used to access the file
handle (!)
• Using a PVLV glob as a subroutine reference
• Coderef assignment when the glob is no longer in the symbol table
• open with a PVLV glob for the filehandle
• -t and -T
• Unopened file handle warnings
|
| |
|
| |
|
|
|
|
|
| |
This better represents its current role as specifically delaying magic on
@ISA as opposed to a general array magic delay mechanism.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Nasty code like the following results in PL_defoutgv not pointing
to a valid GV:
my $x = *STDERR; select($x); $x = 1;
This causes all sorts of SEGVs when PL_defoutgv is subsequently accessed,
because most code assumes that it has a valid gv_gp pointer. It also
turns out that PL_defoutgv is under-tested; for example, temporarily
hacking pp_close to make an arg-less close() croak didn't cause any
minitest failures.
Add a new test file that does some basic testing of a bad PL_defoutgv,
and fix all the obvious badness in accessing it.
This also fixes #20727, which although ostensibly a tie bug, was due to
PL_defoutgv pointing to a tiedelem scalar, and fun like that described
above happening.
|
| |
|
|
|
|
| |
The "short" names become macro wrappers, and the Perl_* versions become mathoms.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
away const, returning a void *. Add MUTABLE_SV(sv) which uses this, and
replace all (SV *) casts either with MUTABLE_SV(sv), or (const SV *).
This probably still needs some work - assigning to SvPVX() and SvRV()
is now likely to generate a casting error. The core doesn't do this.
But as-is it's finding bugs that can be fixed.
p4raw-id: //depot/perl@34605
|
|
|
| |
p4raw-id: //depot/perl@34585
|
|
|
|
|
|
| |
From: "Reini Urban" <rurban@x-ray.at>
Message-ID: <6910a60806080541n4f7e1939q254797411545ebea@mail.gmail.com>
p4raw-id: //depot/perl@34029
|
|
|
|
|
|
|
|
|
|
|
| |
gv_fetchmethod. It therefore needs to duplicate a lot of
the internals of that function.
"Duplicate". <snigger>. You said a naughty word. Now sanitised.
[All tests pass, but I'm not 100% confident that this code is
equivalent in all reachable corner cases, and it may be possible
to simplify the error reporting logic now in gv_fetchmethod_flags]
p4raw-id: //depot/perl@33702
|
|
|
|
|
| |
Nullhek and Nullhv. Nullop is going to be a bit less simple.
p4raw-id: //depot/perl@33051
|
|
|
| |
p4raw-id: //depot/perl@32237
|
|
|
|
|
|
| |
From: "Brandon Black" <blblack@gmail.com>
Message-ID: <84621a60708121336m13dcf9e5uac624fb246f2a79c@mail.gmail.com>
p4raw-id: //depot/perl@31770
|
|
|
| |
p4raw-id: //depot/perl@31396
|
|
|
|
|
|
| |
platforms. On LP64 structs stackinfo, refcounted_he, and magic shrink
by 8 bytes, struct yy_parser by 16.
p4raw-id: //depot/perl@30817
|
|
|
|
|
| |
the GV's name can be NULL.
p4raw-id: //depot/perl@30439
|
|
|
|
|
| |
allows symbolic code references with embeded NULs to work.
p4raw-id: //depot/perl@29830
|
|
|
| |
p4raw-id: //depot/perl@29536
|
|
|
|
|
| |
bad thing.
p4raw-id: //depot/perl@28067
|
|
|
|
|
|
|
| |
COPs created by use can be freed along this memory, but the GP
remains. Given that several GVs may refer to the same file, use a
shared string rather than an individual allocation per GP.
p4raw-id: //depot/perl@28060
|
|
|
|
|
| |
Message-ID: <20060424184451.GA1479@petdance.com>
p4raw-id: //depot/perl@27958
|
|
|
|
|
|
|
| |
First patch from :
Subject: Re: [PATCH] cleanup 212 warnings emitted by gcc-4.2
Message-ID: <20060423044704.6a383ee8@r2d2>
p4raw-id: //depot/perl@27944
|
|
|
|
|
| |
Message-ID: <20060331054228.GA18940@petdance.com>
p4raw-id: //depot/perl@27641
|
|
|
|
|
| |
non-gcc-debugging ifdef. Whoops. Very lax of me)
p4raw-id: //depot/perl@27383
|
|
|
|
|
| |
to simplify GV initialisation.
p4raw-id: //depot/perl@27382
|
|
|
|
|
| |
smaller.
p4raw-id: //depot/perl@27380
|
|
|
|
|
|
|
| |
Saves 1 word in each GV (no more strlen), and will also save the memory
used by the string itself, as the HEK will exist already due to the
key used by the symbol table for this GV.
p4raw-id: //depot/perl@27379
|
|
|
| |
p4raw-id: //depot/perl@27377
|
|
|
|
|
| |
Message-ID: <20060226025216.GA12758@petdance.com>
p4raw-id: //depot/perl@27344
|
|
|
| |
p4raw-id: //depot/perl@27331
|