| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was only ever turning it on, and not turning it off if the sv hap-
pened to have it on from its previous use.
This caused ref() (which uses sv_sethek(TARG,...)) to return a shared
scalar with the UTF8 flag on, even if it was supposed to be off.
For shared scalars, the UTF8 flag on ASCII strings does make a differ-
ence. The pv *and* the flags are used in hash lookup, for speed.
So a scalar returned by ref() with the UTF8 flag on by mistake would
not work in hash lookups. exists $classes{ref $foo} would return
false, even if there were an entry for that class.
|
|
|
|
| |
This has been untrue since it was added in commit 6e592b3a.
|
| |
|
|
|
|
|
|
|
|
|
| |
This adds a new function to sv.c, sv_ref, which is a nul-and-UTF8
clean version of sv_reftype. pp_ref now uses that.
sv_ref() not only returns the SV, but also takes in an SV
to modify, so we can say both sv_ref(TARG, obj, TRUE); and
sv = sv_ref(NULL, obj, TRUE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
$ perl -MScalar::Util=weaken -le 'DESTROY{return if$_++;weaken$_[0]}$x=bless[]'
DESTROY created new reference to dead object 'main' during global destruction.
It says that because the reference count has gone down to -1 (or the
max unsigned value, whichever it is), and the error occurs when
SvREFCNT is true. So there is no new reference to the dead object;
it’s just the refcount that’s off.
This case is worse:
$ perl -MScalar::Util=weaken -le 'DESTROY{weaken$_[0];$x=$_[0]}bless[];'
Segmentation fault
$_[0]’s reference count is normally lowered manually by sv_clear, to
avoid a recursive call to sv_clear (as lowering the reference count
normally triggers that). If the variable has been weakened, then
$_[0] no longer holds a reference count. sv_clear proceeds to destroy
at, as its reference count is 1 (held by $x), causing $x to point to a
freed scalar. Not good.
Since $_[0] is read-only anyway, it should not be weakenable.
|
| |
|
|
|
|
| |
This reverts commit 7f586e41ad4ecd904c7d8dbe1ddb0f9410484bac.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[perl #88330]
If a thinggy is heavily leaked, so that it takes multiple passes through
Perl_sv_clean_all to get its refcount to zero, then if it has weak refs to
it, its backref array may get freed before it. We already set the
refcount of the array to 2 to preserve it across one pass of
Perl_sv_clean_all, but I can't think of a way of protecting it more
generally (short of using a private array structure rather than an AV).
In the past, this caused a scary assertion failure.
Now instead, just skip if we're in global cleanup and the array is freed.
This isn't ideal, but its reasonably robust, as we don't reuse freed SVs
once in global cleanup (so the freed AV hangs around to be identified as
such).
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This disables the fix for [perl #36347], which made sure that unrefer-
enced objects were DESTROYed, marking the tests as to-do.
This bug fix broke three CPAN modules. I will probably not have time
to fix them before 5.14, so disabling the fix until after 5.14 seems
the safest option.
This resolves [perl #82542] and other related tickets.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The addition of the boolkeys op type in commit 867fa1e2d did not
account for the fact that rv2hv (%{}) can sometimes return undef
(%$undef with strict refs turned off).
When the boolkeys op is created (and the rv2hv becomes its kid), the
rv2hv is flagged with OPf_REF, meaning that it must return a hash, not
the contents.
Perl_softrefxv in pp.c checks for that flag. If it is set, it dies
with ‘Can't use an undefined value as a HASH reference’ for unde-
fined values.
This commit changes it to make an exception if rv2hv->op_next is a
boolkeys op. It also changes pp_boolkeys to account for undef.
|
|
|
|
|
|
|
| |
# New Ticket Created by (Peter J. Acklam)
# Please include the string: [perl #81916]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=81916 >
|
|
|
|
|
|
|
|
|
|
| |
On VMS, the last line written to a file will get a trailing newline
willy nilly. This has its advantages insofar as you never get the
"no newline at end of file" warnings from various utilities, but
reality conflicts with expectations when you explicitly test for
the last (or only) line *not* ending with newline, which is what
the recent addtion to ref.t (5e3072707906cc4cb8a364c4cf7c487df0300caa)
was doing. Adding an explicit newline makes everyone happy.
|
| |
|
| |
|
|
|
|
|
|
| |
Fix all the tests that were using quotes, and (by implication) working
because barewords are treated as strings, and one-liners aren't run under
strict.
|
|
|
|
|
| |
test.pl uses "" for command line quoting on Win32, VMS and NetWare, '' on *nix.
Hence what "works on my machine" on *nix may not work elsewhere.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently perl does 3 major scans of the SV arenas, so the action of
perl_destroy() is a bit like this:
for (all arena SVs) {
if (its a ref to an object)
undef the ref (and thus probably free the object)
}
for (all arena SVs) {
if (it's a typeglob and at least one of its slots holds an object) {
set SVf_BREAK on the gv
SvREFCNT_dec(gv)
}
}
return if $PERL_DESTRUCT_LEVEL < 1;
PL_in_clean_all = 1
for (all arena SVs) {
set SVf_BREAK on the sv
SvREFCNT_dec(sv)
}
The second scan is problematic, in that by randomly zapping GVs, it can
leave dangling pointers to freed GVs. This is while perl-level destructors
may still be called, meaning perl users can see corrupted state.
Note also that at this point PL_in_clean_all hasn't been set, so sv_free()
may put out 'Attempt to free unreferenced scalar' warnings.
This commit fixes this by only freeing the affected slots of the GV,
rather than freeing the GV itself. Thus makes it more like the first pass,
which undefs RVs, and ensures no dangling refs.
|
|
|
|
| |
If these can go in for 5.12.0, I'd appreciate it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
blessing filehandles into FileHandle
It turns out that it's not quite as simple as blessing into IO::File.
If you do (just) that, then it breaks any existing code that does
C<require IO::Handle;> to allow it to call methods on file handles,
because they're blessed into IO::File, which isn't loaded. (Note this code
doesn't assume that methods in IO::Seekable are there to be called)
So, it all should work if you also set @IO::File:::ISA correctly?
That way, code that assumes that methods from IO::Handle can be called will
work. However, gv.c now starts complaining (but not failing) if IO::Handle,
IO::Seekable and Exporter aren't present, because it goes looking for
methods in them.
So the solution seems to be to set @IO::File::ISA *and* create (empty)
stashes for the other 3 packages. Patch appended, but not applied.
|
|
|
|
|
|
|
|
| |
It uses reg_temp_copy to copy the REGEXP onto the destination SV without
needing to copy the underlying pattern structure. This means changing
the prototype of reg_temp_copy, so it can copy onto a passed-in SV, but
it isn't API (and probably shouldn't be exported) so I don't think this
is a problem.
|
| |
|
| |
|
|
|
|
|
| |
Message-ID: <20080805195800.xq9k9kttwk0kwsk0@horde.wizbit.be>
p4raw-id: //depot/perl@34171
|
|
|
|
|
| |
Message-ID: <20080628160017.GA81579@osiris.mauzo.dyndns.org>
p4raw-id: //depot/perl@34092
|
|
|
| |
p4raw-id: //depot/perl@30915
|
|
|
|
|
| |
expected to be undef.
p4raw-id: //depot/perl@30913
|
|
|
|
|
|
| |
Test that a glob dereference of a PVIO correctly sets the IO of the
temporary glob that it creates.
p4raw-id: //depot/perl@30537
|
|
|
|
|
| |
allows symbolic code references with embeded NULs to work.
p4raw-id: //depot/perl@29830
|
|
|
|
|
| |
typeglob references.
p4raw-id: //depot/perl@29814
|
|
|
|
|
|
|
|
| |
Subject: Re: [perl #38484] Data::Dumper only warns on unhandled reference types
Message-ID: <20060212171839.GA3604@efn.org>
plus regression tests.
p4raw-id: //depot/perl@27179
|
|
|
|
|
| |
This means that \0 bytes in symbolic references now work.
p4raw-id: //depot/perl@27028
|
|
|
|
|
|
| |
Message-ID: <439592B4.2050101@rowman.com>
Date: Tue, 06 Dec 2005 08:31:32 -0500
p4raw-id: //depot/perl@26280
|
|
|
|
|
|
|
|
|
|
| |
Subject: Re: [perl #37039] perlref documentation about optional -> is too vague
Date: Thu, 1 Sep 2005 17:41:36 -0700
Message-ID: <20050902004136.GA2656@efn.org>
Date: Mon, 5 Sep 2005 08:10:20 -0700
Message-ID: <20050905151020.GA3556@efn.org>
p4raw-id: //depot/perl@25399
|
|
|
| |
p4raw-id: //depot/perl@23763
|
|
|
|
|
| |
Run under strict refs outside the soft reference tests.
p4raw-id: //depot/perl@23760
|
|
|
| |
p4raw-id: //depot/perl@23759
|
|
|
| |
p4raw-id: //depot/perl@23758
|
|
|
|
|
| |
freed
p4raw-id: //depot/perl@23230
|
|
|
|
|
| |
Stop *$$x=$x giving "Attempt to free unreferenced scalar" warning
p4raw-id: //depot/perl@22591
|
|
|
|
|
| |
Message-ID: <20030624121618.GC22675@fdgroup.com>
p4raw-id: //depot/perl@19849
|
|
|
|
|
| |
Message-ID: <20030606054259.GA30249@grazzini.net>
p4raw-id: //depot/perl@19729
|
|
|
|
|
|
|
|
|
|
| |
Subject: Re: [perl #21347] segfault in UNIVERSAL::AUTOLOAD
Date: Sun, 20 Apr 2003 02:45:48 +0300
Message-ID: <20030419234548.GA849@ratsnest.hole>
and
Date: Wed, 2 Apr 2003 07:52:28 +0300
Message-ID: <20030402045227.GA1023@ratsnest.hole>
p4raw-id: //depot/perl@19300
|
|
|
|
|
|
|
|
|
|
| |
by adding a dummy destructor method Regexp::DESTROY.
This prevents infinite recursion, since Regexp::DESTROY
is no more autoloaded.
Subject: Re: [perl #21347] segfault in UNIVERSAL::AUTOLOAD
Message-ID: <20030402020242.GA2966@ratsnest.hole>
p4raw-id: //depot/perl@19277
|
|
|
|
|
|
|
| |
with SIGWARN
Message-ID: <20030121222720.GG293@Bagpuss.unfortu.net>
p4raw-id: //depot/perl@18557
|
|
|
|
|
| |
Message-ID: <14963.32943.102669.67625@soda.csua.berkeley.edu>
p4raw-id: //depot/perl@17717
|
|
|
|
|
|
|
| |
Message-ID: <20011207034544.GN22648@blackrider>
(plus op/ref tweak)
p4raw-id: //depot/perl@13506
|
|
|
| |
p4raw-id: //depot/perl@13352
|
|
|
|
|
|
|
|
|
|
|
|
| |
From: Rafael Garcia-Suarez <rgarciasuarez@free.fr>
Date: Wed, 28 Nov 2001 22:33:08 +0100
Message-ID: <20011128223308.E732@rafael>
Subject: Re: [PATCH] Re: $\ very broken
From: Nicholas Clark <nick@ccl4.org>
Date: Wed, 28 Nov 2001 22:29:00 +0000
Message-ID: <20011128222859.K37621@plum.flirble.org>
p4raw-id: //depot/perl@13345
|