| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
The stack size appropriate to HP-UX is too small for some systems,
where the default is fine. (See <20130816182909.GA14081@iabyn.com>.)
On Mac OS X, the size appropriate to HP-UX is too small, as is the
default.
|
|
|
|
|
|
|
|
| |
The four scripts that use it should declare it a package variable, not a
lexical, otherwise the typeglob used in coretests.pm won't affect it.
Also, we want to set $Verbose to 0, not to $0, if $ENV{PERL_CORE} is set.
These customizations are being pushed upstream in CPAN RT#87513.
|
|
|
|
|
|
| |
Blead customizations have been incorporated and the test scripts no longer
require customizations for blead, but 07locale.t is still out of sync with
the CPAN release.
|
|
|
|
|
| |
In particular, the customizations to four files have now been merged
upstream so we must remove their entries from customized.dat
|
|
|
|
| |
Time::HiRes's Makefile.PL is no longer CUSTOMIZED, as of commit 0f0eae2
|
| |
|
|
|
|
|
|
|
|
|
| |
Commit 8c34e50d inadvertently caused DESTROY caches not to be
reset when UNIVERSAL::DESTROY changes. Normally, a change to
a method will cause mro_method_changed_in to be called on all
subclasses, but mro.c cheats for UNIVERSAL and just does
++PL_sub_generation. So clearing the DESTROY cache explicitly
in mro_method_changed_in is clearly not enough.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
0abd0d78 removed making tries under /di matching, the reason being that
it was broken for many of the upper Latin1 characters, the ones whose
matches aren't fully known until run-time. For example under /di, LATIN
CAPITAL LETTER A WITH GRAVE caselessly matches LATIN SMALL LETTER A WITH
GRAVE if and only if the target string is encoded in UTF-8. Under /ui
matching, these always match, and so tries are constructed for them.
But if a regnode doesn't contain any of the 61 problematic characters (nor
the sequence 'ss' (upper- and/or lowercase), what it matches is fully
known at compile time, and so should be trie-able as-is.
This commit merely keeps track of if any character in the regnode is one
of the 61 or the 'ss' sequence, and if not, changes its type to be /ui
and hence trie-able.
|
|
|
|
| |
and add a warnings.t test case to check for that warning
|
|
|
|
|
|
| |
If $z has been aliased to *foo, then reset("z") would turn off the
SvOK flags on *foo, putting it in an inconsistent state. This could
cause crashes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ticket #119125 represents the breakage caused by c30fc27b4df65a, which
fixed #45667 (/[#]$not_interpolated/x; a regression from 5.000) as a
side-effect of fixing /[#](?{this is not a code block})/x (a regres-
sion from 5.16.0).
It was backported to maint-5.18, which broke several modules, because
bug #45667 is *old*, and many modules depend on it.
So 02682386fe3e on the maint branch modified the fix to apply only to
code blocks, and added tests to make sure that #45667 wasn’t fixed.
#45667 is fixed in blead, but is untested, so grab the tests from
02682386fe3e and reverse the logic of the second one.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
reset was tainting undef if the internal SV type happened to be SVt_PV
or higher. This has got to have been a mistake. Tainting undef or
what is known to be an empty string does not make sense, even in a
tainted expression. Tainting it based on the internal type does not
make sense either, and results in inconsistencies in behaviour (taint
it if it *was* a string, even though it isn’t now, but not if it was a
number, unless that number was tied, or had pos() set, etc.).
This tainting has been here since perl 3.0 (commit a687059cb), which I
think was when tainting was introduced.
Applying the tainting based on the internal type has happened since
79072805bf6 (perl 5.0 alpha 2), which introduced different internal
SV types.
|
|
|
|
|
| |
reset has been wrongly skipping arrays and hashes in the same glob as
read-only scalars since commit 9e35f4b3b4.
|
|
|
|
|
|
| |
This probably incorrectly dies on VMS, based on code inspection. Com-
mit b0269e46d appears to have added the VMS-specific code in the
wrong place.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 9e35f4b3b4 made sv_reset skip SVs other than refs that had
SvTHINKFIRST set. Back then SvTHINKFIRST was only true for refe-
rences and read-only variables, so this change was technically cor-
rect (except for skipping arrays and hashes, which this commit
does not fix).
But SvTHINKFIRST was expanded later (beginning in commit 6fc926691,
by the author of 9e35f4b3b4), making this code in sv_reset wrong.
In all fairness, it was already wrong before for things marked FAKE,
just differently wrong.
|
|
|
|
|
| |
Otherwise bless $tied_ref will die if FETCH hasn’t been called else-
where yet.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
$ ./perl -Ilib -e 'use Devel::Peek; $x = v97; ++$x; Dump $x'
SV = PVMG(0x7fbfa402b698) at 0x7fbfa402eed8
REFCNT = 1
FLAGS = (RMG,POK,pPOK)
IV = 0
NV = 0
PV = 0x7fbfa3c066a8 "b"\0
CUR = 1
LEN = 24
MAGIC = 0x7fbfa3c06348
MG_VIRTUAL = 0
MG_TYPE = PERL_MAGIC_vstring(V)
MG_LEN = 3
MG_PTR = 0x7fbfa3c13ee8 "v97"
The vstring magic is still attached (with something that does not
match the contents of the string), even after modifying it. I
probably broke that in 5.18 after fixing it in 5.16, but I am too
lazy to check.
$ ./perl -le '$x = ${qr//}; $x++; print "$x"'
Assertion failed: (PL_valid_types_IVX[SvTYPE(_svivx) & SVt_MASK]), function Perl_sv_2pv_flags, file sv.c, line 2908.
Abort trap: 6
That I broke when I stopped regexps from being POK in perl 5.18.0.
It was creating a corrupt SV by setting the IOK flag on something of
type SVt_REGEXP.
|
|
|
|
|
|
|
|
|
|
| |
I mean dereferenced regexps, as returned by ${ qr// }.
It was creating a corrupt SV by setting the IOK flag on something
of type SVt_REGEXP.
This is something I broke when I stopped regexps from being POK
in perl 5.18.0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
$ ./perl -le 'BEGIN { print $^H; ${^OPEN} = "a\0b"; print $^H}'
256
917760
So changing $^H back should change the value of ${^OPEN} back to undef, right?
$ ./perl -le 'BEGIN { ${^OPEN} = "a\0b"; $^H=256; print ${^OPEN}//"undef"}'
ab
$ ./perl -le 'BEGIN { ${^OPEN} = "a\0b"; $^H=256;}BEGIN{ print ${^OPEN}//"undef"}'
undef
Apparently you have to hop from one BEGIN block to another to see
the changes.
This happens because compile-time hints are stored in PL_hints (which
$^H sets) but ${^OPEN} looks in PL_compiling.cop_hints. Setting
${^OPEN} sets both. The contents of PL_hints are assigned to
PL_compiling.cop_hints at certain points (the start of a BEGIN block
sees the right value because newSTATEOP sets it), but the two are not
always kept in synch.
The smallest fix here is to have $^H set PL_compiling.cop_hints as
well as PL_hints, but the ultimate fix--to come later--is to merge the
two and stop storing hints in two different places.
|
|
|
|
| |
I broke this when I stopped regexps from being POK in 5.18.
|
|
|
|
|
|
|
|
|
| |
An @INC filter (a subroutined returned by a subroutine in @INC) could
be an lvalue sub that returns a magical scalar for the status. We
need to account for that.
If we don’t call get-magic (FETCH), we’ll get the last value assigned
to or returned from that scalar.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit corrects the one remaining code path in
pp_ctl.c:S_run_user_filter that was not handling non-PVs.
If we have to truncate $_ and keep the remainder in a cache (because
it has more than one line), we need to make sure we don’t assume it is
a PV when it comes to truncating it.
$ ./perl -Ilib -e '@INC = sub { sub { return 0 if $|--; $_ = *{"foo;\nbar"}; return 1 } }; do "foo"'
Assertion failed: (!isGV_with_GP(upstream)), function S_run_user_filter, file pp_ctl.c, line 5494.
Abort trap: 6
|
| |
|
|
|
|
|
|
|
| |
Crazy? Probably. But the existing code partially handles magic val-
ues already; it’s just buggy. Also, the magic value could come from
another source filter that is not registered via @INC, and this is one
way to test that code path.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
@INC filters (code refs returned by code refs in @INC) are given the
current line of code in $_ and can modify it. The C code that invokes
the Perl filter is in pp_ctl.c:S_run_user_filter. It was not taking
into account that $_ might not have a PV pointer when it is returned,
and so this could result in crashes or assertion failures.
This commit forces the scalar to be a string before returning it to
the lexer, unless it is undef. If we force it to be a string when it
is undef, then existing tests start producing uninitialized warnings.
The logic is still faulty in places. Subsequent commits will
address that.
|
|
|
|
|
| |
The logic exempting copy-on-write scalars from read-only checks in
sv_bless was left over from when READONLY+FAKE meant copy-on-write.
|
|
|
|
|
|
| |
Read-only COWs are read-only and should not be treated as though they
were not. This logic is left over from when READONLY+FAKE meant
copy-on-write.
|
|
|
|
|
|
|
|
|
|
|
| |
System select (select with 4 arguments) does not allow any of its
first three arguments to be read-only unless they are undef or
empty strings.
It does not work properly for read-only copy-on-write empty strings,
because it passes all copy-on-write through sv_force_normal under the
expectation that they will shortly be modified. It should not be
doing that for read-only empty strings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
$ ./miniperl -Ilib -e 'for(__PACKAGE__) { s/a/a/ }'
Modification of a read-only value attempted at -e line 1.
$ ./miniperl -Ilib -e 'for(__PACKAGE__) { s/b/b/ }'
$ ./miniperl -Ilib -e 'for("main") { s/a/a/ }'
Modification of a read-only value attempted at -e line 1.
$ ./miniperl -Ilib -e 'for("main") { s/b/b/ }'
Modification of a read-only value attempted at -e line 1.
When I pass the constant "main" to s///, it croaks whether the regular
expression matches or not.
When I pass __PACKAGE__, which has the same content and is also read-
only, it only croaks when the pattern matches.
This commit removes some logic that is left over from when
READONLY+FAKE meant copy-on-write. Read-only does mean read-only now,
so copy-on-write scalars should not be exempt from read-only checks.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It no longer needs to worry about SvIsCOW. This logic is left over
from when READONLY+FAKE was used for COWs.
Since it is possible for COWs to be read-only now, this logic is actu-
ally faulty, as it doesn’t temporarily stop read-only COWs from being
read-only, as it does for other read-only values.
This actually causes discrepancies with scalar-tied locked hash keys,
which differ in readonliness when localised depending on whether the previous value used copy-on-write.
Whether such scalars should be read-only after localisation is open
to debate, but it should not differ based on the means of storing the
previous value.
|
|
|
|
|
|
|
|
|
|
|
|
| |
It no longer needs to worry about SvIsCOW. This logic is left over
from when READONLY+FAKE was used for COWs.
Since it is possible for COWs to be read-only now, this logic is actu-
ally faulty, as it doesn’t temporarily stop read-only COWs from being
read-only, as it does for other read-only values.
This actually causes bugs with scalar-tied locked hash keys, which
croak on FETCH.
|
|
|
|
|
|
|
|
|
|
|
| |
$ ./perl -Ilib -e 'use constant nullrocow => (keys%{{""=>undef}})[0]; for(nullrocow) { y/a/b/ }'
$ ./perl -Ilib -e 'use constant nullro => ""; for(nullro) { y/a/b/ }'
Modification of a read-only value attempted at -e line 1.
It should croak on COW scalars that are read-only, even if they are
zero-length, just as it does on non-COW scalars.
This logic is left over from when READONLY+FAKE meant COW.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is existing code to pipe fixed input to the test perl's STDIN, which
means that STDIN can be made to be an immediate end-of-file by giving an
empty string. However, it turns out that on platforms which use ksh as
/bin/sh, ksh's setup of shell pipelines differs from a traditional Bourne
shell (and bash), using one less process in total, with the result that the
test perl starts with a child process already - the process piping to its
STDIN. This unexpected child process confuses tests for wait() which are
only expecting to see return values from processes that the test script
itself started.
As the problem case is specifically for setting up STDIN to be at EOF, it's
easier to it by enhancing test.pl's runperl() to be able to redirect STDIN
from the null device than by making the tests themselves more complex.
This approach also avoids spawning a process for quite a few of the tests.
Fortuitously it seems that the string /dev/null is portable enough to work
with the command line parsing code on VMS and Win32 too.
Thanks to Zefram for helping diagnose the problem.
It turns out that this also fixes regressions on VMS, where the pipe
implementation returns the exit code of the process at the front of the
pipeline, not the end. The result is that adding a pipeline messes up any
test using OPTION FATAL to check exit status.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These were added by commit ed6b3797850720f7 ("make t/op/misc.t work on VMS")
in Jan 2001 back when the relevant code was in t/op/misc.t
The two adjustments each only applied to one test in t/run/fresh_perl.t
Was: system './perl -ne "print if eof" /dev/null'
Became: system './perl -ne "print if eof" NL:'
Was: print "ok\n" if (-e _ and -f _ and -r _);
Became: print "ok\n" if (-e _ and -f _);
The latter had the comment "VMS file locking".
It seems that neither is needed now. Perl will recognise "/dev/null" as
the null device, and -r returns true on a file opened for reading.
The "adjustments", particularly the second, should have been done all along
in the code for the test itself, not by complicating the test runner.
|
|
|
|
|
| |
Commit c30fc27b appended lines in the file to after the editor hints
lines. This caused my vim to not notice them.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was brought up in ticket #117855.
PL_compiling is a cop-sized static buffer (inside the interpreter
struct under threads) that stores information during compile time
(such as file name and line number) that gets copied to each cop (con-
trol op; aka state op or nextstate op) as it is created.
Some values are not actually stored in PL_compiling, such as the
current stash (PL_curstash is used instead) and the current hints
(PL_hints is used).
The ops in each statement are created before that statement’s cop
is created.
At run time, each cop is executed at the start of the statement and
sets PL_curcop to point to itself, so that operators within that
statement can get information from PL_curcop.
Constant folding was copying the contents of PL_compiling into a tem-
porary cop used to execute the ops being folded. That constant fold-
ing happened of course before the cop was created for that statement.
Now it just happened that commit a0ed51b321 back in 1998 modified
newSTATEOP to copy hints to PL_compiling in addition to the new cop
being created. Presumably that was to fix the type of bug that this
commit is addressing. (Presumably this commit renders those changes
unnecessary.) That meant that most of the time constant folding would
see the right hints.
That fails, though, when it comes to the first statement in a string
eval. When you do eval("uc(ä)"), the constant folding happens when
PL_compiling.cop_hints still points to whatever value it had before
the eval was executed; i.e., an unpredictable value. Slight changes
to unrelated scopes (and, apparently, using a different compiler*) can
cause the result of that string eval to change.
The solution is to set the hints from PL_hints explicitly when doing
constant folding.
* <https://rt.perl.org/rt3/Ticket/Display.html?id=117855#txn-1241613>ff.
I never got to the bottom of why the compiler would make a diffe-
rence here. Finding out would involve setting a watchpoint on
PL_compiling.cop_hints in a C debugger and then stepping through
the thousands of times PL_compiling changes, which is too much
work. Nevertheless, I know this fix is correct, as it changes
PL_compiling.cop_hints from having a non-deterministic value during
constant folding to having a predictable one.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the substitution target is assigned to in pp_substcont, it is
assumed that SvPV_free and SvPOK_only_UTF8 can be used on that target.
Only COW scalars are sent through sv_force_normal.
Changing the target in the replacement code can render those assump-
tions untrue:
$ ./perl -Ilib -e '$h = 3; $h =~ s/3/$h=\3;4/e'
Assertion failed: (!((targ)->sv_flags & 0x00000800) || !(*({ SV *const _svrv = ((SV *)({ void *_p = (targ); _p; })); (__builtin_expect(!(PL_valid_types_RV[((svtype)((_svrv)->sv_flags & 0xff)) & 0xf]), 0) ? __assert_rtn(__func__, "pp_ctl.c", 269, "PL_valid_types_RV[SvTYPE(_svrv) & SVt_MASK]") : (void)0); (__builtin_expect(!(!((((_svrv)->sv_flags & (0x00004000|0x00008000)) == 0x00008000) && (((svtype)((_svrv)->sv_flags & 0xff)) == SVt_PVGV || ((svtype)((_svrv)->sv_flags & 0xff)) == SVt_PVLV))), 0) ? __assert_rtn(__func__, "pp_ctl.c", 269, "!isGV_with_GP(_svrv)") : (void)0); (__builtin_expect(!(!(((svtype)((_svrv)->sv_flags & 0xff)) == SVt_PVIO && !(((XPVIO*) (_svrv)->sv_any)->xio_flags & 64))), 0) ? __assert_rtn(__func__, "pp_ctl.c", 269, "!(SvTYPE(_svrv) == SVt_PVIO && !(IoFLAGS(_svrv) & IOf_FAKE_DIRP))") : (void)0); &((_svrv)->sv_u.svu_rv); }))), function Perl_pp_substcont, file pp_ctl.c, line 269.
Abort trap: 6
Also, matching against a hash key and locking that key with Hash::Util
within the replacement code can cause the substitution to modify that
hash key without triggering ‘Modification of a read-only value’. But
this only happens if it is not a copy-on-write scalar:
$ ./perl -Ilib -MHash::Util=lock_hash -le '$h{foo} = 3; $h{foo} =~ s/3/$h{foo} = 3; lock_hash %h; 4/e; print $h{foo}'
4
We need to do a regular SV_THINKFIRST_COW_DROP check here, just as we
do in sv_setsv with regular scalar assignment.
Also, we need to take into account real globs:
$ ./perl -Ilib -MHash::Util=lock_hash -le '$::{foo} =~ s//*{"foo"}; 4/e'
Assertion failed: (!isGV_with_GP(targ)), function Perl_pp_substcont, file pp_ctl.c, line 259.
Abort trap: 6
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
$ ./perl -wIlib -Mconstant' u=>undef' -e '()=$a{+u} if $a'
Use of uninitialized value at -e line 1.
Well, I didn’t even execute that hash lookup, so why is it warning me
about an uninitialized value?
This is a compile-time optimisation to turn hash keys into shared hash
key scalars (containing precomputed hashes) to speed up key lookup.
It stringifies the hash key at compile time as part of the process.
The value should not be stringified if that would cause observable
difference with tied hashes. Commit 04698ff67 fixed this for refs,
globs and regexps, but missed undef scalars.
This could be considered part of bug #79178.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the latest (development) release on CPAN. It will shortly be
superseded by 1.23.
Note that Makefile.PL is only customized -- not excluded as well! Two
customized test files (actually, one changed and one added) which blead
had (but were not noted in the Maintainers.pl file!) are incorporated in
this release.
Also, change the UPSTREAM status from undef to 'blead' to reflect the fact
that GBARR is no longer actively maintaining libnet and for the immediate
future new CPAN releases are only likely to be rolled to keep in sync with
changes in blead, plus occasional simple patches from the CPAN RT queue.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a compile-time regex like /...(?{ code-block }) .../
is compiled in the presence of constant and concat overloading,
this can cause (still at compile-time) for the pattern to be evaled and
re-compiled, in order to re-compile any code-blocks that got messed up
during the overloading and thus whose text no longer matches that which
the perl parser previously compiled.
When this happens, eval_sv() happens to be called when the perl parser is
still in compiling state; normally its called from running state.
This tickles an undiscovered bug in Perl_find_runcv_where(), which
finds the current cop sequence by looking at PL_curcop->cop_seq.
At compile time, we need to get it from PL_cop_seqmax instead.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The refactoring of fbm_compile in 66379c06cd to prepare for
c72a4eedff1 put in an SvIsCOW check before doing SvPV_force. I sim-
ply changed the logic there so that SvPV_force would continue to have
its effect but without tripping up on read-only variables for which
SvPV_force would not need to make any changes anyway.
Now, if a COW scalar is read-only, we can’t call SvPV_force on it,
because it will die.
It turns out that we don’t actually need to call SvPV_force on COWs.
We can just go ahead and attach the BM magic and continue sharing
the buffer.
|
|
|
|
|
|
|
|
|
|
| |
In the case of a sub definition with a prototype, the prototype
is not attached to the sub until after the body is completely
defined. This means that any sub which calls itself will
not honor its prototype unless the prototype was declared prior to
the sub's definition. Whether or not this behavior is desirable is
debatable, but its far too late to do anything about it other than
document it and test to make sure it doesn't change.
|
|
|
|
|
|
|
|
| |
gv_check was only checking for stashes nested directly inside them-
selves (*foo:: = *foo::foo) and the main stash.
Other stash circularities would cause infinite recursion, blowing the
C stack and crashing.
|
|
|
|
|
|
|
| |
CopFILESV points to ${"_<filename"}, which can be modified by Perl
code. Under non-threaded builds, newGP (which records the file name
used by ‘used once’ warnings) was using CopFILESV for the file name.
It is safer just to use the name of the GV itself.
|