This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Karl Williamson [Tue, 27 Mar 2012 16:03:30 +0000 (10:03 -0600)]
reg_fold.t: Allow to work on early Unicodes
If the version of Unicode being compiled doesn't have the modern
casefolding .txt file, get the values from Unicode::UCD. Also for
EBCDIC, where otherwise the file would have to be translated.
Karl Williamson [Tue, 27 Mar 2012 15:54:53 +0000 (09:54 -0600)]
mk_PL_charclass.pl: Allow to work on early Unicodes
If the version of Unicode being compiled doesn't have the modern
casefolding .txt file, get the values from Unicode::UCD. Also for
EBCDIC, where otherwise the file would have to be translated.
Karl Williamson [Tue, 27 Mar 2012 14:52:02 +0000 (08:52 -0600)]
fold_grind.t: Allow to work on early Unicodes
If the version of Unicode being tested doesn't have the modern
casefolding .txt file, get the values from Unicode::UCD. Also for
EBCDIC, where otherwise the file would have to be translated.
Karl Williamson [Tue, 27 Mar 2012 13:26:47 +0000 (07:26 -0600)]
fold_grind.t: read environment variable just once
Setting a lexical variable to the environment variable made it easier
for me to temporarily override things during a sequence of tests that
took place on many different occasions where I needed this set and kept
forgetting to set the environment variable.
Karl Williamson [Sun, 25 Mar 2012 04:01:35 +0000 (22:01 -0600)]
mktables: Extend Name_Alias property to early Unicode releases
This uses this property so that charnames can work on early Unicode
releases, by including all the aliases that were previously defined in
charnames until Unicode 6.1 started defining them itself.
Karl Williamson [Thu, 5 Apr 2012 15:36:52 +0000 (09:36 -0600)]
charnames.t: White-space only
Indent newly formed block
Karl Williamson [Tue, 27 Mar 2012 03:37:31 +0000 (21:37 -0600)]
charnames.t: Fix to work on Unicodes without NameAliases
This is a recent addition. Use alternate means if the file doesn't
exist in the Unicode release, or is for a non-ASCII platform (as the
alternate means should take care of the translation in that case).
Karl Williamson [Tue, 27 Mar 2012 03:23:45 +0000 (21:23 -0600)]
charnames.t: Skip hangul syllable testing for early Unicodes
If the Unicode release doesn't contain hangul syllables, just skip those
tests
Karl Williamson [Tue, 27 Mar 2012 03:22:38 +0000 (21:22 -0600)]
charnames.t: Indent newly formed block
Karl Williamson [Tue, 27 Mar 2012 03:19:14 +0000 (21:19 -0600)]
charnames.t: Skip testing named sequences if don't exist
Instead of dying when applied to a Unicode version that doesn't have
named sequences, skip them.
Karl Williamson [Mon, 26 Mar 2012 18:35:04 +0000 (12:35 -0600)]
installperl: CaseFolding.txt no longer needed
A previous commit has removed the dependency on this file.
Karl Williamson [Mon, 26 Mar 2012 18:31:20 +0000 (12:31 -0600)]
Unicode::UCD::casefold(): Don't use .txt file for source
This converts this function to using the outputs of prop_invmap() to get
its casefolding definitions. This allows it to work on versions of
Unicode which don't have this file, allows the file to not have to be
installed, and removes this function from having to be different on
EBCDIC platforms (which wasn't coded anyway).
Karl Williamson [Mon, 26 Mar 2012 18:16:08 +0000 (12:16 -0600)]
UCD.t: Don't use BEL for $/
This causes failures on early Unicode releases, and is not necessary
Karl Williamson [Mon, 26 Mar 2012 18:15:06 +0000 (12:15 -0600)]
UCD.t: Skip PropValueAliases tests on early Unicodes
Karl Williamson [Mon, 26 Mar 2012 18:14:27 +0000 (12:14 -0600)]
UCD.t: Skip tests for PropertyAlias on early Unicodes
Karl Williamson [Mon, 26 Mar 2012 18:13:26 +0000 (12:13 -0600)]
UCD.t: Use v-string for easier version comparison
Karl Williamson [Mon, 26 Mar 2012 18:09:10 +0000 (12:09 -0600)]
UCD.t: white-space only
Indent because a previous commit surrounded this with an 'if'
Karl Williamson [Mon, 26 Mar 2012 18:04:22 +0000 (12:04 -0600)]
Unicode::UCD: Fix blocks to work on early Unicodes
Not all Unicode releases supported blocks
Karl Williamson [Mon, 26 Mar 2012 17:58:26 +0000 (11:58 -0600)]
Unicode::UCD: Fix to work on Unicodes without script property
Karl Williamson [Mon, 26 Mar 2012 17:53:04 +0000 (11:53 -0600)]
Unicode::UCD::compexcl(): Fix to work on early Unicodes
Karl Williamson [Mon, 26 Mar 2012 17:46:44 +0000 (11:46 -0600)]
Unicode::UCD::charinfo(): Fix to handle decomps in early Unicode releases
There are no hangul syllables in early releases.
Karl Williamson [Mon, 26 Mar 2012 17:43:55 +0000 (11:43 -0600)]
Unicode::UCD::prop_invmap(): Fix so handles dm in earlier Unicodes
Some versions of Unicode did not have hangul syllables; and there is a
bug in handling them that doesn't show up in the latest versions.
Karl Williamson [Mon, 26 Mar 2012 17:39:51 +0000 (11:39 -0600)]
Unicode::UCD::prop_invmap: Fix so works on very early Unicode
Some versions of Unicode don't have the AHex property. Instead use
[:xdigit:] which is defined in all versions.
Karl Williamson [Mon, 26 Mar 2012 17:36:58 +0000 (11:36 -0600)]
Unicode::UCD::prop_invmap(): Fix to work on early Unicodes
The scf property was originally known as the sfc property. This handles
both possibilities.
Karl Williamson [Mon, 26 Mar 2012 17:34:52 +0000 (11:34 -0600)]
Unicode::UCD::num(): Fix so works on early Unicode releases
This has to do extra work for releases prior to 6.0.
Karl Williamson [Mon, 26 Mar 2012 17:30:03 +0000 (11:30 -0600)]
Unicode::UCD::charinfo(): get ISO comment for earlier Unicodes
This field had meaning in earlier Unicode versions.
Karl Williamson [Mon, 26 Mar 2012 17:24:05 +0000 (11:24 -0600)]
Unicode::UCD: Store v-string Unicode version.
This value will be used in future commits to make version comparisons
easier.
Karl Williamson [Mon, 26 Mar 2012 17:17:48 +0000 (11:17 -0600)]
mktables: Fix up Unicod 2.18 special casing file
which had duplicate entries.
Karl Williamson [Mon, 26 Mar 2012 17:15:53 +0000 (11:15 -0600)]
mktables: Fix-up for Unicode version 1
The Unicode data files for version 1 have a number of errors and
anomalies in them.
Karl Williamson [Mon, 26 Mar 2012 17:13:25 +0000 (11:13 -0600)]
mktables: Add definitions for missing property value aliases
This is for early Unicode releases where things were omitted.
Karl Williamson [Mon, 26 Mar 2012 17:11:55 +0000 (11:11 -0600)]
mktables: Add Unicode_1_names if missing from early Unicode releases
Karl Williamson [Mon, 26 Mar 2012 17:07:03 +0000 (11:07 -0600)]
mktables: Allow simple_mapfoo tables to work in early Unicode releases
Not all Unicode releases have the special casing file; a previous commit
has already added this necessary processing to the mainline code
execution; no need to do it twice.
Karl Williamson [Mon, 26 Mar 2012 17:03:56 +0000 (11:03 -0600)]
mktables: Work around bug in early Unicode databases
Fix up the erroneous fields
Karl Williamson [Mon, 26 Mar 2012 16:50:27 +0000 (10:50 -0600)]
mktables: Fix to enable XIDS property in early Unicode releases
Construct this property if isn't in the Unicode version being compiled,
as it is needed by the Perl core to function
Karl Williamson [Mon, 26 Mar 2012 16:37:03 +0000 (10:37 -0600)]
mktables: Compile \w correctly on early Unicode versions
Early Unicode versions did not have the Connector_Punctuation property.
In those cases the underscore should still be part of \p{Word}.
Karl Williamson [Mon, 26 Mar 2012 16:29:43 +0000 (10:29 -0600)]
mktables: Consolidate handling of Cased property
This moves all the handling dealing with Cased to one place, and fixes
it so it works properly when compiling Unicode versions without the
official Cased property.
Karl Williamson [Mon, 26 Mar 2012 16:11:51 +0000 (10:11 -0600)]
mktables: Fix for Unicode versions without fold, special casing
This code was supposed to work on early Unicode releases which did not
have the special casing and casefold .txt files in them, but was broken.
Processing is moved earlier to set these tables up before the loop that
populates the default mapping for all Unicode tables, so that that loop
will automatically process these as well.
Karl Williamson [Mon, 26 Mar 2012 16:01:57 +0000 (10:01 -0600)]
mktables: Suppress invalid warning on early Unicode releases
When a Unicode release is compile which doesn't have titlecasing the
table is created anyway, but is empty. This suppresses the empty table
sanity check warning, since it's sane for this to be empty in those
versions
Karl Williamson [Mon, 26 Mar 2012 15:53:29 +0000 (09:53 -0600)]
mktables: Move assignment out of loop
This assignment only needs to be done once.
Karl Williamson [Mon, 26 Mar 2012 15:51:31 +0000 (09:51 -0600)]
mktables: White-space only
A previous commit removed the block this code was contained in, so can
outdent and reflow the comments to take up the full width available
Karl Williamson [Mon, 26 Mar 2012 15:48:43 +0000 (09:48 -0600)]
mktables: remove now-always-true test
A previous commit causes the Name_Alias property to be defined in all
Unicode versions, so no longer have to test it.
Karl Williamson [Sun, 25 Mar 2012 04:01:35 +0000 (22:01 -0600)]
mktables: Extend Name_Alias property to early Unicode releases
This uses this property so that charnames can work on early Unicode
releases, by including all the aliases that were previously defined in
charnames until Unicode 6.1 started defining them itself.
Karl Williamson [Mon, 26 Mar 2012 15:16:17 +0000 (09:16 -0600)]
mktables: Loop should begin at 0
This loop is supposed to flush all the input buffering for the fields of
UCD.txt, but skipped field 0, the name field. This is not a problem
except for compiling very early Unicode versions where the final entry in
the file could be a real name. Subsequent versions have the final entry
be for nameless private use code points, so this bug is not triggered
for them.
Karl Williamson [Mon, 26 Mar 2012 15:11:10 +0000 (09:11 -0600)]
mktables: Add input error check and warning
Karl Williamson [Mon, 26 Mar 2012 15:07:34 +0000 (09:07 -0600)]
mktables: Add overload for '&=' on property objects
Karl Williamson [Mon, 26 Mar 2012 15:00:37 +0000 (09:00 -0600)]
mk_invlists.pl: Add error check and die if fails
Karl Williamson [Mon, 26 Mar 2012 03:47:42 +0000 (21:47 -0600)]
mktables: Move dummy table generation earlier
These two tables are not furnished by Unicode in early releases, but if
they are not present, Perl's regex code will fail very ungracefully when
trying to deal with \X. Therefore, we create placeholders for these so
that the code will degrade gracefully when Perl is run with early
Unicode versions.
This patch moves the generation of these placeholder tables to a
function that gets executed earlier in the process. This allows the
loop that follows the new placement to create the proper match tables
and fill in the defaults, like it does for all other Unicode properties.
This allows this commit to remove special tests for the existence of
these properties as well.
This is an interim patch. Future commits will actually fill in these
tables, making them non placeholders.
Karl Williamson [Mon, 26 Mar 2012 15:30:40 +0000 (09:30 -0600)]
mktables: Suppress warnings for placeholder tables
Placeholder tables are anomalous, and so may run afoul of sanity checks,
unless those are suppressed for them.
Karl Williamson [Fri, 23 Mar 2012 17:59:42 +0000 (11:59 -0600)]
mktables: Lowercase property name to conform with Unicode
For some reason, they use the name lowercased; this change makes it
easier for mktables to work in earlier versions of Unicode when this
property is not available, and mktables constructs a dummy one itself
Karl Williamson [Fri, 23 Mar 2012 17:49:19 +0000 (11:49 -0600)]
mktables: Remove unnecessary code
These lines just duplicate what's in the subsequent 'else'
Karl Williamson [Fri, 23 Mar 2012 17:37:20 +0000 (11:37 -0600)]
mktables: White-space only
This indents the loop to correctly align under a newly added block, and
reflows to fit in 80 columns
Karl Williamson [Fri, 23 Mar 2012 17:35:26 +0000 (11:35 -0600)]
mktables: skip some processing in debug mode
Otherwise, it tends to fail.
Karl Williamson [Fri, 23 Mar 2012 17:31:31 +0000 (11:31 -0600)]
mktables: Optionally create normalization test file
Unicode furnishes a rather complete normalization test suite. This code
adds an option to mktables to use that input to create a test file for
Perl.
Due to its slowness, about 400K tests, this is not currently enabled by
default.
Karl Williamson [Fri, 23 Mar 2012 17:29:08 +0000 (11:29 -0600)]
mktables: Shorten test file name
This is in preparation for actually using it. This makes sure it works
on DOS 8.3 filenames.
Karl Williamson [Fri, 1 Jun 2012 19:32:43 +0000 (13:32 -0600)]
podcheck.t: Fix more transitory file problems
If a file has been removed since it was first found, it is considered
transitory, and its pod, if any, should not be checked. This fixes two
places where podcheck.t just died when this happens.
Sullivan Beck [Wed, 30 May 2012 14:25:47 +0000 (10:25 -0400)]
Bump Locale-Codes from 3.21 to 3.22
Nicholas Clark [Fri, 1 Jun 2012 15:45:12 +0000 (17:45 +0200)]
If kill 0, PPID works, use it to avoid race conditions in t/op/getppid.t
POSIX allows one to use kill 0, PPID to detect if a process exists.
(Strictly that the current process is permitted to signal it, which is the
case here). If the system is sufficiently POSIXy, use kill 0, PPID to detect
that the parent has terminated, instead of just sleeping and hoping for the
best.
(Strictly to ensure the test terminates, there is still a race condition,
but if your test system is so loaded that a process takes more than 10
seconds to terminate, you've likely got bigger problems you need to address
first.)
Nicholas Clark [Fri, 1 Jun 2012 13:40:51 +0000 (15:40 +0200)]
In t/op/getppid.t remove most race conditions by signaling using pipes.
Previously t/op/getppid.t used sleep calls in the child and grandchild to
(attempt to) sequence actions between them. This was a subtle race condition,
which could come unstuck on busy systems causing spurious test failures.
Instead use EOF on pipes as a cheap portable way to synchronise between
processes. This eliminates one sleep call completely. Unfortunately, we can't
completely eliminate the other, as the grandchild spots that the child's
exit has closed the pipe *before* the child completely exits. Hence retain
the sleep to (usually) give time for the child to completely exit. This
reduces the race condition to "sleep 2" vs "child finishes exiting", which
is much less than the previous race condition of "sleep 2" vs "child does
everything from returning from fork to exiting".
Nicholas Clark [Fri, 1 Jun 2012 13:32:47 +0000 (15:32 +0200)]
In t/op/getppid.t, die if any pipe close fails.
It shouldn't happen, but the diagnostics will be useful if does.
Tony Cook [Sat, 2 Jun 2012 02:36:02 +0000 (12:36 +1000)]
Tony Cook [Sat, 2 Jun 2012 02:15:21 +0000 (12:15 +1000)]
[perl #64772] allow for sync on read only handles
This is useful on Linux for when you open a directory with open() and
then sync the directory eg, after a rename.
Tested on Linux, NetBSD, Solaris, Haiku-OS, Darwin, cygwin.
Tests are skipped on VMS (where I have no idea if it will work), Win32
(for which opening directories requires special permissions).
Evan Miller [Thu, 31 May 2012 13:52:26 +0000 (23:52 +1000)]
[perl #64772] check both input and output file handles for sync
This allows sync() to be called on directory handles.
Originally supplied as a diff, applied and updated to pass tests by
Tony Cook.
Tony Cook [Thu, 31 May 2012 13:43:18 +0000 (23:43 +1000)]
add Evan Miller to AUTHORS
Tony Cook [Thu, 31 May 2012 09:34:44 +0000 (19:34 +1000)]
[perl #64772] TODO test for sync on read only handle
Tony Cook [Thu, 31 May 2012 09:27:45 +0000 (19:27 +1000)]
convert dist/IO/t/io_xs.t to Test::More
Craig A. Berry [Fri, 1 Jun 2012 03:02:21 +0000 (22:02 -0500)]
Fix K & R-style function definition in VMS::Stdio.
C++ doesn't speak K & R.
Nicholas Clark [Thu, 31 May 2012 21:02:23 +0000 (23:02 +0200)]
Merge refactoring of t/op/filetest.t into blead.
Nicholas Clark [Thu, 24 May 2012 14:05:08 +0000 (16:05 +0200)]
Use is() and isnt() in t/op/filetest.t, in place of ok().
These automatically give diagnostics on failure, allowing the elimination
of two explicit calls to diag(). Also split one ok(... && ...) test into
two.
Nicholas Clark [Thu, 24 May 2012 13:49:08 +0000 (15:49 +0200)]
In t/op/filetest.t, test -s -f 'TEST' against the size from stat 'TEST'.
Previously the test was "is it greater than 1?"
Nicholas Clark [Thu, 24 May 2012 09:57:21 +0000 (11:57 +0200)]
In t/op/filetest.t, use the tempfile instead of t/TEST in two tests.
This avoids needing to skip the two tests if t/TEST is a symlink, which is
the case when building with -Dmksymlinks.
Nicholas Clark [Thu, 24 May 2012 09:40:41 +0000 (11:40 +0200)]
In t/op/filetest.t, use one temporary file for testing instead of two.
The readonly file tests aren't worried about the file's length, and the
zero-length file tests aren't concerned about whether it's writable, so it's
possible to use the same file in both tests.
Nicholas Clark [Thu, 24 May 2012 09:23:06 +0000 (11:23 +0200)]
In t/op/filetest.t, simplify the logic for testing read-only files.
Only attempted to change the effective user ID if the test is running as
root. Don't bother consulting $Config to see whether assigning to $> is going
to work - just try it in an eval, and skip if it didn't. Only restore $> if
we know we changed it, and as we only change it from root, we already know
which value to restore it to.
The previous code to check $Config{d_seteuid} was incomplete, as it should
also have been checking for $Config{d_setreuid} and $Config{d_setresuid}, as
$> can use any of these.
Nicholas Clark [Thu, 24 May 2012 08:45:00 +0000 (09:45 +0100)]
In t/op/filetest.t, simplify the skip logic when testing -r and -w on op.
This code has got excessively hairy. Originally, t/op/filetest.t was added
to test that various file test operators worked as expected. (Commit
42e55ab11744b52a in Oct 1998.) It used the file t/TEST and the directory
t/op for targets. To test that read-only files were detected correctly, it
would chmod 0555 TEST to set it read only.
The test would fail if run as root, because root can write to anything. So
logic was added to set the effective user ID to 1 by assigning to $> in an
eval (unconditionally), and restoring $> afterwards. (Commit
846f25a3508eb6a4
in Nov 1988.) Curiously, the restoration was done after the test for
C<-r op>, rather than before it.
Most strangely, a skip was then added for the C<-w op> test based on
$Config{d_seteuid}. The test runs after $> has been restored, so should have
nothing to do with setuid. It was added as part of the VMS-related changes of
commit
3eeba6fb8b434fcb in May 1999. As d_seteuid is not defined in VMS, this
makes the test skip on VMS.
Commit
15fe5983b126b2ad in July 1999 added a skip for the read-only file
test if d_seteuid is undefined. Which is actually the only test where having
a working seteuid() *might* matter (but only if running as root, so that $>
can be used to drop root privileges).
Commit
fd1e013efb606b51 in August 1999 moved the restoration of $> earlier,
ahead of the test for C<-r op>, as that test could fail if run as root with
the source tree unpacked with a restrictive umask. (Bug ID
19990727.039)
Nicholas Clark [Thu, 31 May 2012 09:28:21 +0000 (11:28 +0200)]
t/porting/checkcase.t shouldn't scan .git for case-clashing files.
The contents of the .git directory are outside our control. In particular,
as fetch doesn't default to --prune, someone pushing a branch upstream with
a name which case-conflicts with a previously deleted branch will cause
action-at-a-distance failures, because locally .git/logs/refs/remotes will
contain both.
Nicholas Clark [Thu, 31 May 2012 09:15:20 +0000 (11:15 +0200)]
t/porting/checkcase.t should find() from the top level, not from '..'
This permits it to be usefully run from the top level of the build tree.
Previously it would find() on '..', which meant that one needed to chdir into
t/ else it would report errors for the contents of the directory containing
the build tree.
Craig A. Berry [Wed, 30 May 2012 23:57:51 +0000 (18:57 -0500)]
A more C++-friendly dNOOP.
The problem with Perl___notused under C++ is that in some cases
it's merely extern, and in some cases (via the XS macro via the
XSPROTO macro) it's extern "C". Object code analysis shows that
you do actually get one mangled and one unmangled version of the
symbol, which wouldn't matter since the whole point is to have
something we never use.
Except that one very picky C++ compiler (HP C++ for OpenVMS) sees
what we're up to and slaps us down hard. Since declaration after
statement has always been allowed in C++, just go ahead and do a
real noop statement for C++ and avoid the use of an external
symbol.
Steve Hay [Wed, 30 May 2012 13:06:55 +0000 (14:06 +0100)]
Don't install HTML docs for 'ext' folder
After building, everything in 'ext' is in 'lib' anyway so including
the 'ext' folder as well as 'lib' just results in duplicate docs in
a slightly different folder structure.
Father Chrysostomos [Wed, 30 May 2012 06:55:55 +0000 (23:55 -0700)]
[Merge] Yank study
study was made a no-op in 5.16, but the code was left in place,
unused. This branch removes the code implementing study, leaving
pp_study and screaminstr as stubs.
Father Chrysostomos [Thu, 24 May 2012 21:54:29 +0000 (14:54 -0700)]
sv.h: Document the only use of SvSCREAM
Now that studied scalars are gone, SvSCREAM is used only for the DOES
method name hack, so update sv.h accordingly.
Father Chrysostomos [Thu, 24 May 2012 21:53:38 +0000 (14:53 -0700)]
Delete two instance of SvSCREAM_off
that no longer have any effect.
Father Chrysostomos [Thu, 24 May 2012 21:49:19 +0000 (14:49 -0700)]
Use isGV_with_GP in util.c:fbm_compile
This little statement:
if (SvSCREAM(sv))
return;
filters out not only studied strings, but also GVs.
Since studied strings are gone, it only filters out GVs now. Since
fbm_compile coerces its argument, we still want to filter out GVs, so
we use isGV_with_GP to make the intent clear.
Father Chrysostomos [Thu, 24 May 2012 21:45:41 +0000 (14:45 -0700)]
Away with REXEC_SCREAM!
Actually, we cannot remove the definition, as there are CPAN modules
that need it; but they only test the flag, and never set it, so perl
doesn’t need to keep testing it itself.
Father Chrysostomos [Thu, 24 May 2012 21:04:02 +0000 (14:04 -0700)]
Expunge study magic
I’m running out of synonyms for ‘remove’.
Father Chrysostomos [Thu, 24 May 2012 21:00:56 +0000 (14:00 -0700)]
Gut screaminstr
How did this ever end up in the API?
Anyway, this commit guts it by removing its guts and replacing it with
a panic message. This function would fail assertions if passed an
unstudied scalar, so it should never be called any more. But XS mod-
ules that still do if (SvSCREAM(sv)) screaminstr(...) should still be
able to compile.
Father Chrysostomos [Thu, 24 May 2012 20:52:32 +0000 (13:52 -0700)]
Remove most code conditional on SvSCREAM
Since pp_study is now a no-op, SvSCREAM should always be false on
non-GVs, except for the method name hack.
Father Chrysostomos [Thu, 24 May 2012 20:47:39 +0000 (13:47 -0700)]
Correct apidoc varnames for util.c:fbm_instr
Father Chrysostomos [Thu, 24 May 2012 06:54:14 +0000 (23:54 -0700)]
Delete the contents of pp_study
Father Chrysostomos [Thu, 24 May 2012 05:44:25 +0000 (22:44 -0700)]
Don’t clone closures in rv2cv
Commit
07055b4c536 (Support named closures) added code to make refer-
encing a closure prototype clone the prototype. Commit
28757baaaeaa
(inseparable changes from patch from perl5.003_19 to perl5.003_20),
which includes ‘Subject: Rescind named closures’ in its log, appar-
ently did not rescind ‘named closures’ completely, leaving a line of
code that was completetly unused and untested, until just now when I
tried doing something bizarre to see whether some other piece of code
was buggy. This wasn’t what I expected. :-)
$ ./perl -Ilib -e 'sub MODIFY_CODE_ATTRIBUTES{\&{$_[1]};} my $x; +sub :bar{$x}'
Assertion failed: (depth || SvTYPE(proto) == SVt_PVFM), function Perl_cv_clone, file pad.c, line 1890.
Abort trap
Father Chrysostomos [Thu, 24 May 2012 04:51:45 +0000 (21:51 -0700)]
Remove ‘Runaway prototype’ warning
This has been here since commit
8472ac73d, which was merged into blead
in commit
55d729e4e15, if I understand the history correctly.
This warning is undocumented, and triggerable only by stash
manipulation.
It appears to be an internal check, similar to a ‘panic’ error, but
its wording doesn’t suggest anything of the sort.
A ‘sub foo;’ declaration doesn’t actually create the sub yet, but
simply puts -1 in the stash element. ‘sub foo($);’ puts '$' in the
stash element.
If newATTRSUB sees something there it doesn’t recognise, it unhelp-
fully carps ‘Runaway prototype’, but it is pretty random:
This is OK:
$ perl -e 'BEGIN{$::{foo}=undef} sub foo;'
But this is not:
$ perl -e 'BEGIN{$::{foo}=-1; $::{foo}=undef} sub foo;'
Runaway prototype at -e line 1.
Also, it only happens when the sub has no body, not for ‘sub foo {}’:
$ perl -e 'BEGIN{$::{foo}=56} sub foo{}'
$ perl -e 'BEGIN{$::{foo}=56} sub foo;'
Runaway prototype at -e line 1.
This warning is random, incomprehensible, and not at all helpful, so
we should just remove it.
Ricardo Signes [Fri, 25 May 2012 12:40:18 +0000 (08:40 -0400)]
update the editor hints for spaces, not tabs
This updates the editor hints in our files for Emacs and vim to request
that tabs be inserted as spaces.
Ricardo Signes [Mon, 14 May 2012 13:01:06 +0000 (09:01 -0400)]
clarify that it must be a simple identifier in {}
suggestion from Aristotle Pagaltzis in
https://rt.perl.org/rt3/Ticket/Display.html?id=112914
Reini Urban [Tue, 29 May 2012 21:06:00 +0000 (16:06 -0500)]
related to [perl #113060] assert CopSTASH(cx->blk_oldcop)
HvNAME_HEK((HV*)CopSTASH(cx->blk_oldcop)) does some implicit assumptions, which should
better be asserted. Also record CX pp_caller reads besides PUSH and POP.
Reini Urban [Tue, 29 May 2012 20:46:13 +0000 (15:46 -0500)]
[perl #113060] Save cop_stashlen threaded even with shared cop pv
Perl_sv_compile_2op_is_broken() does at line 3354 a LEAVE_with_name("eval"),
a SSPOPSTR via SAVEt_SHARED_PVREF for the localized cop_stashpv, but
not for the cop_stashlen.
The cop in question is PL_compiling, which was "AutoSplit" before with
len=9 and restores it back to "main" but keeps len 9. Thus leading to a
heap-overflow in gv_stashpvn.
Father Chrysostomos [Sun, 22 Apr 2012 02:12:21 +0000 (19:12 -0700)]
[perl #97478] Make ‘Can’t find opnumber’ UTF-8- and null-clean
Father Chrysostomos [Tue, 29 May 2012 16:38:19 +0000 (09:38 -0700)]
[Merge] More coresubs
Until now, only overridable keywords had subs in the CORE:: namespace.
This branch adds subs to the CORE:: namespace for those non-overrida-
ble keywords that can be implemented without custom parsers.
Father Chrysostomos [Sat, 26 May 2012 12:47:08 +0000 (05:47 -0700)]
bproto.t: Test pos(1,$b)
I nearly broke this.
Father Chrysostomos [Tue, 15 May 2012 21:42:50 +0000 (14:42 -0700)]
Update CORE.pod to reflect the new coresubs
Father Chrysostomos [Tue, 15 May 2012 05:26:15 +0000 (22:26 -0700)]
Make &CORE::undef(\*_) undefine it properly
Unless called as &CORE::undef (without parentheses) after @_ has been
set to \*_, it leaves @_ in the ARRAY slot.
This is an implementation detail leaking through.
pp_entersub temporarily aliases @_ to a new array, which is restored
to its previous value on sub exit.
Since &CORE::undef is a perl sub with an op tree containing
an undef op,
$ ./perl -Ilib -MO=Concise,CORE::undef -e '\&CORE::undef'
CORE::undef:
3 <1> leavesublv[1 ref] K/REFC,1 ->(end)
2 <1> undef sKP/1 ->3
1 <$> coreargs(IV 44) s ->2
-e syntax OK
the undef op runs while @_ is localised.
So we should un-localise @_ if we detect that case.
Doing this in pp_coreargs might be a bit of a hack, but it’s less
code than rewriting &CORE::undef as an XSUB, which would be the
other option.
Either way, we need a special case, since undef is the only named op
that touches the ARRAY slot of the glob passed to it.
Father Chrysostomos [Sun, 13 May 2012 06:18:50 +0000 (23:18 -0700)]
&CORE::undef should be an lvalue sub
Father Chrysostomos [Sun, 13 May 2012 02:05:24 +0000 (19:05 -0700)]
Add &CORE::undef
In the error message, we can’t say ‘&CORE::undef operator’, so we
should be using the op name, rather than the op description.
Instead of using OP_NAME(PL_op->op_next), which would expand to
PL_op->op_next->op_type == OP_CUSTOM
? XopENTRY(Perl_custom_op_xop(aTHX_ PL_op->op_next), xop_name)
: PL_op_name[PL_op->op_next->op_type]
we can simply use PL_op_name[opnum], which should be quicker.
pp_undef can already handle nulls on the stack.
There is one remaining problem. If &CORE::undef(\*_) is called, *_
will be undefined while @_ is localised during the sub call, so it
won’t have the same effect as undef *_. I don’t know whether this
should be considered a bug or not, but I could solve it by making
pp_undef an XSUB.