summaryrefslogtreecommitdiff
path: root/gv.h
Commit message (Collapse)AuthorAgeFilesLines
* Deprecate tie $handle without *Father Chrysostomos2010-12-021-0/+3
|
* [perl #77362] Assigning glob to lvalue causes stringificationFather Chrysostomos2010-09-261-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* fix indendation of DM_* flag definitionsDavid Mitchell2010-06-041-5/+5
|
* express DM_[GU]ID flags in terms of componentsDavid Mitchell2010-06-041-2/+2
|
* rename DM_ARRAY flag to DM_ARRAY_ISADavid Mitchell2010-06-041-1/+1
| | | | | This better represents its current role as specifically delaying magic on @ISA as opposed to a general array magic delay mechanism.
* Fix clang "incompatible operand types" error in ternary expressions.George Greer2010-05-271-1/+1
|
* PL_defoutgv isn't always a GV.David Mitchell2010-03-301-0/+1
| | | | | | | | | | | | | | | | | | | | 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.
* Merge gv_IOadd() into gv_add_by_type().Nicholas Clark2009-08-081-0/+1
|
* Merge gv_AVadd(), gv_HVadd() and gv_SVadd() into gv_add_by_type().Nicholas Clark2009-08-081-0/+4
| | | | The "short" names become macro wrappers, and the Perl_* versions become mathoms.
* Remove GvREFCNT_inc(), which is deprecated and unused.Nicholas Clark2009-08-071-3/+0
|
* GvUNIQUE* have been defined as 0 since 2005/06/30 - high time to remove them.Nicholas Clark2009-04-131-10/+0
|
* Add a macro MUTABLE_PTR(p), which on (non-pedantic) gcc will not castNicholas Clark2008-10-271-1/+1
| | | | | | | | | | 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
* Update copyright years.Nicholas Clark2008-10-251-2/+2
| | | p4raw-id: //depot/perl@34585
* readable assertion namesReini Urban2008-06-081-17/+17
| | | | | | From: "Reini Urban" <rurban@x-ray.at> Message-ID: <6910a60806080541n4f7e1939q254797411545ebea@mail.gmail.com> p4raw-id: //depot/perl@34029
* /* This code tries to figure out just what went wrong withNicholas Clark2008-04-171-0/+2
| | | | | | | | | | | 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
* Deprecate (and remove core use of ) Nullav, Nullcv, Nullgv, Nullhe,Nicholas Clark2008-01-231-1/+3
| | | | | Nullhek and Nullhv. Nullop is going to be a bit less simple. p4raw-id: //depot/perl@33051
* Fix up copyright years for files modified in 2007.Nicholas Clark2007-11-071-1/+1
| | | p4raw-id: //depot/perl@32237
* Re: optimize push @ISA, (was Re: parent.pm at http://corion.net/perl-dev)Brandon Black2007-08-311-0/+1
| | | | | | From: "Brandon Black" <blblack@gmail.com> Message-ID: <84621a60708121336m13dcf9e5uac624fb246f2a79c@mail.gmail.com> p4raw-id: //depot/perl@31770
* More portability nits by JarkkoRafael Garcia-Suarez2007-06-161-1/+1
| | | p4raw-id: //depot/perl@31396
* Rearrange members of structures to reduce memory size on someNicholas Clark2007-03-311-5/+5
| | | | | | platforms. On LP64 structs stackinfo, refcounted_he, and magic shrink by 8 bytes, struct yy_parser by 16. p4raw-id: //depot/perl@30817
* Don't SEGV when dumping an undefined typeglob. The HEK used to storeNicholas Clark2007-03-011-1/+1
| | | | | the GV's name can be NULL. p4raw-id: //depot/perl@30439
* Add get_cvn_flags(), which is like get_cv() but takes a length. ThisNicholas Clark2007-01-151-0/+4
| | | | | allows symbolic code references with embeded NULs to work. p4raw-id: //depot/perl@29830
* Assert that PVGVs are never SvVALID() in the PVBM sense.Nicholas Clark2006-12-121-0/+1
| | | p4raw-id: //depot/perl@29536
* Another place where Intel C++ pretending to be gcc is a reallySteve Peters2006-05-021-1/+1
| | | | | bad thing. p4raw-id: //depot/perl@28067
* GvFILE() cannot be a pointer to the memory owned by the COP, becauseNicholas Clark2006-05-021-2/+13
| | | | | | | 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
* use NOOP macroAndy Lester2006-04-251-2/+2
| | | | | Message-ID: <20060424184451.GA1479@petdance.com> p4raw-id: //depot/perl@27958
* Ensure GvNAME doesn't return NULLMarcus Holland-Moritz2006-04-241-3/+4
| | | | | | | First patch from : Subject: Re: [PATCH] cleanup 212 warnings emitted by gcc-4.2 Message-ID: <20060423044704.6a383ee8@r2d2> p4raw-id: //depot/perl@27944
* Random accumulated patchesAndy Lester2006-03-311-3/+2
| | | | | Message-ID: <20060331054228.GA18940@petdance.com> p4raw-id: //depot/perl@27641
* Change 27380 (HEK into the IV union failed to convert the code in theNicholas Clark2006-03-051-1/+1
| | | | | non-gcc-debugging ifdef. Whoops. Very lax of me) p4raw-id: //depot/perl@27383
* Perl_gv_name_set should not leak the old HEK. Allow the flag GV_ADDNicholas Clark2006-03-051-1/+3
| | | | | to simplify GV initialisation. p4raw-id: //depot/perl@27382
* Move the GvNAME HEK into the IV union - every GV is now 1 pointerNicholas Clark2006-03-051-1/+1
| | | | | smaller. p4raw-id: //depot/perl@27380
* Use a HEK to store the GV's name, rather than a malloc()ed string.Nicholas Clark2006-03-051-12/+8
| | | | | | | 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
* Provide Perl_gv_name_set to replace LVALUE use of GvNAME and GvNAMESET.Nicholas Clark2006-03-051-14/+17
| | | p4raw-id: //depot/perl@27377
* fix up gv.c and gv.hAndy Lester2006-02-271-3/+3
| | | | | Message-ID: <20060226025216.GA12758@petdance.com> p4raw-id: //depot/perl@27344
* Fix argument grouping for some macrosRafael Garcia-Suarez2006-02-271-5/+5
| | | p4raw-id: //depot/perl@27331
* GvFLAGS can be overlaid with SvCUR.Nicholas Clark2006-02-251-2/+2
| | | p4raw-id: //depot/perl@27330
* Use xpv_len rather than xpv_cur in GVs to store GvASSIGN_GENERATION.Nicholas Clark2006-02-251-2/+2
| | | | | Assert that GVs do not access SvCUR or SvLEN. p4raw-id: //depot/perl@27328
* Abstract the specific use of SvCUR in GVs for detecting variables onNicholas Clark2006-02-251-0/+5
| | | | | | both sides of an assignment using GvASSIGN_GENERATION() and GvASSIGN_GENERATION_set(). p4raw-id: //depot/perl@27327
* xgv_stash can be stored as a union with the NV, reducing the size ofNicholas Clark2006-02-251-2/+2
| | | | | PVGVs by another pointer. p4raw-id: //depot/perl@27326
* Amazingly, it seems that none of the other GV specific macros areNicholas Clark2006-02-251-17/+30
| | | | | accessed unless the GV thinks that it is a GV. p4raw-id: //depot/perl@27324
* Store GvGP in the SV head union. For all the common lookups [eg GvCV()]Nicholas Clark2006-02-251-2/+3
| | | | | | | | this avoids 1 pointer dereference and the associated risk of a CPU cache miss. Although this patch looks deceptively small, I fear its CBV(*) might be rather high. (* Crack By Volume) p4raw-id: //depot/perl@27323
* Assert that GvSTASH is only called on PVGVs and PVLVs.Nicholas Clark2006-02-241-1/+9
| | | p4raw-id: //depot/perl@27307
* Revert an assert() fix in the light of change #27152Steve Hay2006-02-131-4/+2
| | | | | | | | | | | | | | The MinGW problem described here: http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-01/msg00146.html was fixed by change #26664. This is no longer relevant in the light of change #27152, so revert it. (The other problems with VC++ 6 and BCC, fixed by change #26634, have not gone away, however.) p4raw-link: @27152 on //depot/perl: b0e6ae5b51a7c163ac7cdb0d18b54bb1819f6c13 p4raw-link: @26664 on //depot/perl: fb9e8e97420770e8f89d9f2196e1b7b0c855e8bb p4raw-link: @26634 on //depot/perl: 834268b87a8eb670d899a13106c8dfcdfc7c9b66 p4raw-id: //depot/perl@27171
* s/Nullcv/NULL/gSteven Schubiger2006-02-031-1/+1
| | | | | | Message-ID: <20060202150241.GF12591@accognoscere.homeunix.org> Date: Thu, 2 Feb 2006 16:02:41 +0100 p4raw-id: //depot/perl@27060
* gv_fetchpvn_flags ranks highly in the profile, and the ::/' scanningNicholas Clark2006-02-021-0/+2
| | | | | | | loop is iterated over millions of times. Add a flag GV_NOTQUAL purely as an optimisation, when the caller is passing in a string that is known not to contain any package separators. p4raw-id: //depot/perl@27053
* Workaround another problem following change 26395Steve Hay2006-01-051-2/+4
| | | | | MinGW doesn't like 26395 either! (ref: change 26634) p4raw-id: //depot/perl@26664
* More copyright updatesRafael Garcia-Suarez2006-01-041-1/+1
| | | p4raw-id: //depot/perl@26652
* Workaround Win32 compiler bugs following change 26395Steve Hay2006-01-041-1/+5
| | | | | | | | Can't understand what VC++ 6 and Borland don't like about it. There is similar code for SvMAGIC and SvSTASH already in sv.h. Must be compiler bugs since VC++ 7 and MinGW (and compilers on other platforms) are all happy. p4raw-id: //depot/perl@26634
* Add an optimisation to allow proxy constant subroutines to be copiedNicholas Clark2005-12-221-0/+1
| | | | | | | as proxy constant subroutines in a new symbol table where possible. (Rather than converting them to full blown constant subroutines and instantiating 2 typeglobs) p4raw-id: //depot/perl@26446
* Add a GV_NOADD_NOINIT flag to gv_fetch{pv,pvn,sv} that disablesNicholas Clark2005-12-201-0/+5
| | | | | | | addition of new typeglobs, and also disables initialisation of any typeglob placeholders. Needed to make the new constant subroutine proxy references work efficiently. p4raw-id: //depot/perl@26425