Karl Williamson [Tue, 26 Feb 2013 20:45:19 +0000 (13:45 -0700)]
utf8.c: Use more clearly named macro
In the case of invariants these two macros should do the same thing,
but it seems to me that the latter name more clearly indicates what is
going on.
Karl Williamson [Tue, 26 Feb 2013 20:35:12 +0000 (13:35 -0700)]
Add macro OFFUNISKIP
This means use official Unicode code point numbering, not native. Doing
this converts the existing UNISKIP calls in the code to refer to native
code points, which is what they meant anyway. The terminology is
somewhat ambiguous, but I don't think it will cause real confusion.
NATIVE_SKIP is also introduced for situations where it is important to
be precise.
Karl Williamson [Tue, 26 Feb 2013 20:22:19 +0000 (13:22 -0700)]
toke.c: white space only
Karl Williamson [Sun, 17 Feb 2013 21:00:13 +0000 (14:00 -0700)]
toke.c: Don't remap \N{} for EBCDIC
Everything but \N{U+XXXX} is now in native,
Karl Williamson [Tue, 26 Feb 2013 19:08:50 +0000 (12:08 -0700)]
utf8.c: Stop using two functions
This is in preparation for deprecating these functions, to force any
code that has been using these functions to change.
Since the Unicode tables are now stored in native order, these
functions should only rarely be needed.
However, the functionality of these is needed, and in actuality, on
ASCII platforms, the native functions are #defined to these. So what
this commit does is rename the functions to something else, and create
wrappers with the old names, so that anyone using them will get the
deprecation when it actually goes into effect: we are waiting for CPAN
files distributed with the core to change before doing the deprecation.
According to cpan.grep.me, this should affect fewer than 10 additional
CPAN distributions.
Karl Williamson [Tue, 26 Feb 2013 18:26:09 +0000 (11:26 -0700)]
Convert uvuni_to_utf8() to function
Code should almost never be dealing with non-native code points
This is in preparation for later deprecation when our CPAN modules have
been converted away from using it.
Karl Williamson [Tue, 26 Feb 2013 18:02:33 +0000 (11:02 -0700)]
Deprecate utf8_to_uni_buf()
Now that the tables are stored in native order, there is almost no need
for code to be dealing in Unicode order.
According to grep.cpan.me, there are no uses of this function in CPAN.
Karl Williamson [Tue, 26 Feb 2013 03:26:44 +0000 (20:26 -0700)]
Deprecate valid_utf8_to_uvuni()
Now that all the tables are stored in native format, there is very
little reason to use this function; and those who do need this kind of
functionality should be using the bottom level routine, so as to make it
clear they are doing nonstandard stuff.
According to grep.cpan.me, there are no uses of this function in CPAN.
Karl Williamson [Tue, 26 Feb 2013 03:14:26 +0000 (20:14 -0700)]
utf8.c: Swap which fcn wraps the other
This is in preparation for the current wrapee becoming deprecated
Karl Williamson [Tue, 26 Feb 2013 02:29:34 +0000 (19:29 -0700)]
utf8.c: Skip a no-op
Since the value is invariant under both UTF-8 and not, we already have
it in 'uv'; no need to do anything else to get it
Karl Williamson [Tue, 26 Feb 2013 02:26:50 +0000 (19:26 -0700)]
utf8.c: Move comment to where makes more sense
Karl Williamson [Tue, 26 Feb 2013 00:30:10 +0000 (17:30 -0700)]
APItest: Test native code points, instead of Unicode
Karl Williamson [Mon, 25 Feb 2013 00:23:15 +0000 (17:23 -0700)]
Don't refer to U+XXXX when mean native
These messages say the output number is Unicode, but it is really
native, so change to saying is 0xXXXX.
Karl Williamson [Sun, 24 Feb 2013 23:43:59 +0000 (16:43 -0700)]
Convert some uvuni() to uvchr()
All the tables are now based on the native character set, so using
uvuni() in almost all cases is wrong.
Karl Williamson [Sun, 24 Feb 2013 23:25:47 +0000 (16:25 -0700)]
handy.h: White space only
Karl Williamson [Sun, 24 Feb 2013 23:19:49 +0000 (16:19 -0700)]
t/test.pl: Allow native/latin1 string conversions to work on utf8.
These functions no longer have the hard-coded definitions in them,
but now end up resolving to internal functions, so that new encodings
could be added and these would automatically understand them.
Instead of using tr///, these now go character by character and
converting to/from ord, which is slower, but allows them to operate on
utf8 strings.
Peephole optimization should make these essentially no-ops on ascii
platforms.
Karl Williamson [Sun, 24 Feb 2013 23:05:55 +0000 (16:05 -0700)]
t/test.pl: Simplify ord to/from native fcns
This commit changes these functions from converting to/from a string to
calling functions which operate on ordinals instead that are in the
utf8:: namespace.
Karl Williamson [Sun, 24 Feb 2013 22:35:38 +0000 (15:35 -0700)]
Make casing tables native
These are final tables that haven't been converted to native character
set casing.
Karl Williamson [Sun, 24 Feb 2013 22:32:30 +0000 (15:32 -0700)]
utfebcdic.h: Remove trailing spaces
Karl Williamson [Sat, 23 Feb 2013 01:55:26 +0000 (18:55 -0700)]
EBCDIC has the unicode bug too
We have not had a working modern Perl on EBCDIC for some years. When I
started out, comments and code led me to conclude erroneously that
natively it supported semantics for all 256 characters 0-255. It turns
out that I was wrong; it natively (at least on some platforms) has the
same rules (essentially none) for the characters which don't correspond
to ASCII ones, as the rules for these on ASCII platforms.
A previous commit for 5.18 changed the docs about this issue. This
current commit forces ASCII rules on EBCDIC platforms (even should there
be one that natively uses all 256). To get all 256, the same things
like 'use feature "unicode_strings"' must now be done.
Karl Williamson [Thu, 21 Feb 2013 20:47:52 +0000 (13:47 -0700)]
handy.h: Solve a failure to compile problem under EBCDIC
handy.h is included in files that don't include perl.h, and hence not
utf8.h. We can't rely therefore on the ASCII/EBCDIC conversion
macros being available to us. The best way to cope is to use the native
ctype functions. Most, but not all, of the macros in this commit
currently resolve to use those native ones, but a future commit will
change that.
Karl Williamson [Thu, 21 Feb 2013 20:35:12 +0000 (13:35 -0700)]
handy.h: Simplify some macro definitions
Now, only one of the macros relies on magic numbers (isPRINT), leading
to clearer definitions.
Karl Williamson [Thu, 21 Feb 2013 20:26:49 +0000 (13:26 -0700)]
handy.h: Combine macros that are same in ASCII, EBCDIC
These 4 macros can have the same RHS for their ASCII and EBCDIC
versions, so no need to duplicate their definitions
This also enables the EBCDIC versions to not have undefined expansions
when compiling without perl.h
Karl Williamson [Wed, 20 Feb 2013 17:39:48 +0000 (10:39 -0700)]
Deprecate NATIVE_TO_NEED and ASCII_TO_NEED
These macros are no longer called in the Perl core. This commit turns
them into functions so that they can use gcc's deprecation facility.
I believe these were defective right from the beginning, and I have
struggled to understand what's going on. From the name, it appears
NATIVE_TO_NEED taks a native byte and turns it into UTF-8 if the
appropriate parameter indicates that. But that is impossible to do
correctly from that API, as for variant characters, it needs to return
two bytes. It could only work correctly if ch is an I8 byte, which
isn't native, and hence the name would be wrong.
Similar arguments for ASCII_TO_NEED.
The function S_append_utf8_from_native_byte(const U8 byte, U8** dest)
does what I think NATIVE_TO_NEED intended.
Karl Williamson [Wed, 20 Feb 2013 17:26:43 +0000 (10:26 -0700)]
Remove remaining calls of NATIVE_TO_NEED
These calls are just copying the input to the output byte by byte.
There is no need to worry about UTF-8 or not, as the output is just an
exact copy of the input
Karl Williamson [Wed, 20 Feb 2013 15:12:15 +0000 (08:12 -0700)]
toke.c: Remove some NATIVE_TO_NEED calls
I believe NATIVE_TO_NEED is defective, and will remove it in a future
commit. But, just in case I'm wrong, I'm doing it in small steps so
bisects will show the culprit. This removes the calls to it where the
parameter is clearly invariant under UTF-8 and UTF-EBCDIC, and so the
result can't be other than just the parameter.
Karl Williamson [Wed, 20 Feb 2013 15:22:07 +0000 (08:22 -0700)]
toke.c: Emphasize that only [A-Za-z] is used here
This code is attempting to deal with the problem of holes in the ranges
a-z and A-Z in EBCDIC. By using macros with the suffix "_A", we
emphasize that.
Karl Williamson [Tue, 19 Feb 2013 22:13:19 +0000 (15:13 -0700)]
Use real illegal UTF-8 byte
The code here was wrong in assuming that \xFF is not legal in UTF-8
encoded strings. It currently doesn't work due to a bug, but that may
eventually be fixed: [perl #116867]. The comments are also wrong that
all bytes are legal in UTF-EBCDIC.
It turns out that in well-formed UTF-8, the bytes C0 and C1 never appear
(C2, C3, and C4 as well in UTF-EBCDIC), as they would be the start byte
of an illegal overlong sequence.
This creates a #define for an illegal byte using one of the real illegal
ones, and changes the code to use that.
No test is included due to #116867.
Karl Williamson [Sun, 17 Feb 2013 20:50:45 +0000 (13:50 -0700)]
toke.c: Remove remapping for EBCDIC for octal
The code prior to this commit converted something like \04 into its
EBCDIC equivalent only in double-quoted strings. This was not done in
patterns, and so gave inconsistent results. The correct thing to do
should be to do the native thing, what someone who works on a platform
would think \04 do. Platform independent characters are available
through \N{}, either by name or by U+XXXX.
The comment changed by this was wrong, as in some cases it was native,
and in some cases Unicode.
Karl Williamson [Sun, 17 Feb 2013 20:47:13 +0000 (13:47 -0700)]
Remove EBCDIC remappings
Now that the Unicode tables are stored in native format, we shouldn't be
doing remapping.
Note that this assumes that the Latin1 casing tables are stored in
native order; not all of this has been done yet.
Karl Williamson [Sun, 17 Feb 2013 19:46:05 +0000 (12:46 -0700)]
Add and use macro to return EBCDIC
The conversion from UTF-8 to code point should generally be to the
native code point. This adds a macro to do that, and converts the
core calls to the existing macro to use the new one instead. The old
macro is retained for possible backwards compatibility, though it
probably should be deprecated.
Karl Williamson [Sat, 16 Feb 2013 18:05:44 +0000 (11:05 -0700)]
charnames: Make work in EBCDIC
Now that mktables generates native tables, we need to make U+XXXX mean
Unicode instead of native.
Karl Williamson [Sat, 16 Feb 2013 16:35:56 +0000 (09:35 -0700)]
Unicode::UCD: Work on non-ASCII platforms
Now that mktables generates native tables, it is a fairly simple matter
to get Unicode::UCD to work on those platforms.
Karl Williamson [Fri, 15 Feb 2013 05:16:38 +0000 (22:16 -0700)]
mktables: Generate native code-point tables
The output tables for mktables are now in the platform's native
character set. This means there is no change for ASCII platforms, but
is a change for EBCDIC ones.
Code that didn't realize there was a potential difference between EBCDIC
and non-EBCDIC platforms will now start to work; code that tried to do
the right thing under these circumstances will no longer work. Fixing
that comes in later commits.
Karl Williamson [Wed, 3 Apr 2013 03:36:28 +0000 (21:36 -0600)]
mktables: Move table creation code
This code is moved later in the process. This is in preparation for
mktables generating tables in the native character set. By moving it to
later, the translation to native has already been done, and special
coding need not be done.
This also caught 7 code points that were omitted somehow in the previous
logic
Karl Williamson [Thu, 14 Feb 2013 17:50:00 +0000 (10:50 -0700)]
Fix some EBCDIC problems
These spots have native code points, so should be using the macros for
native code points, instead of Unicode ones; this also changes to use
the portable symbolic name of a code point instead of the non-portable
hex.
Karl Williamson [Thu, 14 Feb 2013 05:10:19 +0000 (22:10 -0700)]
Remove unnecessary temp variable in converting to UTF-8
These areas of code included a temporary that is unnecessary.
Karl Williamson [Thu, 14 Feb 2013 05:00:55 +0000 (22:00 -0700)]
utf8.h: Correct macros for EBCDIC
These macros were incorrect for EBCDIC. The 3 step process given in
utfebcdic.h wasn't being followed.
Karl Williamson [Sun, 10 Feb 2013 04:23:30 +0000 (21:23 -0700)]
Extract common code to an inline function
This fairly short paradigm is repeated in several places; a later commit
will improve it.
Karl Williamson [Fri, 8 Feb 2013 04:35:57 +0000 (21:35 -0700)]
Don't use EBCDIC macro for a C language escape
C recognizes '\a' (for BEL); just use that instead of a look-up.
regen/unicode_constants.pl could be used to generate the character for
the ESC (set in nearby code), but I didn't do that because of
potential bootstrapping problems when porting to an EBCDIC platform
without a working perl. (The other characters generated in that .pl are
less likely to cause problems when compiling perl.)
Karl Williamson [Fri, 8 Feb 2013 02:53:38 +0000 (19:53 -0700)]
Use byte domain EBCDIC/LATIN1 macro where appropriate
The macros like NATIVE_TO_UNI will work on EBCDIC, but operate on the
whole Unicode range. In the locations affected by this commit, it is
known that the domain is limited to a single byte, so the simpler ones
whose names contain LATIN1 may be used.
On ASCII platforms, all the macros are null, so there is no effective
change.
Karl Williamson [Thu, 7 Feb 2013 21:31:09 +0000 (14:31 -0700)]
Use new clearer named #defines
This converts several areas of code to use the more clearly named macros
introduced in the previous commit
Karl Williamson [Thu, 7 Feb 2013 20:52:31 +0000 (13:52 -0700)]
utf8.h, utfebcdic.h: Create less confusing #defines
This commit creates macros whose names mean something to me, and which I
don't find confusing. The older names are retained for backwards
compatibility. Future commits will fix bugs I introduced from
misunderstanding the meaning of the older names.
The older names are now #defined in terms of the newer ones, and moved
so that they are only defined once, valid for both ASCII and EBCDIC
platforms.
Karl Williamson [Mon, 4 Feb 2013 21:22:02 +0000 (14:22 -0700)]
pp_ctl.c: Use isCNTRL instead of hard-coded mask
This is clearer and portable to EBCDIC.
There is a subtle difference in the behavior here, which I believe is a
bug fix. Before, the code didn't treat DEL as a control, and now it
does.
Karl Williamson [Tue, 26 Feb 2013 20:51:05 +0000 (13:51 -0700)]
utf8.c: is_utf8_char_slow() should use native length
What is passed is the actual length of the native utf8 character. What
this was calculating was the length it would be if it were a Unicode
character, and then compared, apples to oranges.
Steve Hay [Thu, 29 Aug 2013 12:55:32 +0000 (13:55 +0100)]
Stop t/op/coreamp.t leaving temporary files behind
test.pl will delete any file made by tempfile(), but it won't delete the
*.dir and *.pag files made by dbmopen. Hopefully this is the right way to
delete them, cribbed from lib/AnyDBM_File.t.
Steve Hay [Thu, 29 Aug 2013 12:42:15 +0000 (13:42 +0100)]
Stop t/io/utf8.t leaving a temporary file behind on Windows
Filehandles need to be closed for unlink to work on Windows.
Steve Hay [Thu, 29 Aug 2013 12:06:50 +0000 (13:06 +0100)]
Prevent ExtUtils-CBuilder leaving test output on Windows
The link function call in the have_compiler and have_cplusplus tests create
a compilet.def file on Windows which is correctly recorded for cleaning up
when the EU::CB object is destroyed, but if another one gets made in the
meantime then ExtUtils::Mksymlists::Mksymlists moves the first one to
compilet_def.old, which isn't recorded for cleaning up and gets left
behind when the test script has finished. Using a new object each time,
destroying the previous one first, prevents this.
Nicholas Clark [Thu, 29 Aug 2013 09:02:40 +0000 (11:02 +0200)]
Update the comments in t/op/magic.t
(This should have been part of the previous commit, but I forgot to --amend
it)
Nicholas Clark [Thu, 29 Aug 2013 08:47:31 +0000 (10:47 +0200)]
${^MPEN} had been treated as a synonym of ${^MATCH} due to a missing break;
A missing break; in Perl_gv_fetchpvn_flags() meant that the variable ${^MPEN}
had been behaving as a synonym of ${^MATCH}. Adding the break makes ${^MPEN}
behave like all other unused multi-character control character variable.
Steve Hay [Thu, 29 Aug 2013 07:37:10 +0000 (08:37 +0100)]
perldelta - Rewordings in the light of
fa3234e35d
H.Merijn Brand [Thu, 29 Aug 2013 07:45:07 +0000 (09:45 +0200)]
regen Configure after backports
os-types are sorted
Father Chrysostomos [Thu, 29 Aug 2013 07:12:36 +0000 (00:12 -0700)]
perl5200delta: Mention broken modules from #119463
Father Chrysostomos [Thu, 29 Aug 2013 06:12:07 +0000 (23:12 -0700)]
inline.h: Avoid redundant ckWARN call
ckWARN calls Perl_ckwarn. So does Perl_ck_warner. So there is no
need to use both.
Father Chrysostomos [Thu, 29 Aug 2013 05:45:41 +0000 (22:45 -0700)]
perldiag: Reword/rewrap embedded null warning
‘syscall arguments’ implies arguments to the syscall() function,
which is not the case here. Also reword the rest to sound better
in English.
Father Chrysostomos [Thu, 29 Aug 2013 05:40:47 +0000 (22:40 -0700)]
perlpacktut: mention h2ph
Mentioning syscall.ph without saying how to get it is not
as helpful as it could be.
Father Chrysostomos [Thu, 29 Aug 2013 01:36:22 +0000 (18:36 -0700)]
Increase $XS::APItest::VERSION to 0.56
Father Chrysostomos [Thu, 29 Aug 2013 01:34:22 +0000 (18:34 -0700)]
Make vivify_defelem allow &PL_sv_undef array entries
This is something I failed to change in commit ce0d59f. I don’t know
of a way to trigger this in pure-Perl code, hence the use of XS in
the test. It did show up in pure-Perl code due to a bug fixed by the
previous commit.
Father Chrysostomos [Thu, 29 Aug 2013 01:20:41 +0000 (18:20 -0700)]
Stop creating defelems for undef in foreach(@_)
This is part of ticket #119433. This particular bug is triggered by
Data::Dump’s test suite.
Commit ce0d59f changed arrays to use NULL for nonexistent elements,
instead of &PL_sv_undef (the special scalar returned by Perl’s ‘undef’
operator).
‘foreach’ was not updated to account. It was still treating
&PL_sv_undef as a nonexistent element. This was causing ‘Modifica-
tion of non-creatable array value attempted, subscript 0’, due to a
similar bug in vivify_defelem, which the next commit will fix.
(Fixing vivify_defelem without fixing foreach will make the test pass,
but for foreach to create a defelem to begin with is inefficient and
should be addressed anyway.)
Father Chrysostomos [Wed, 28 Aug 2013 23:36:12 +0000 (16:36 -0700)]
perldelta: typo
Ricardo Signes [Thu, 29 Aug 2013 01:24:30 +0000 (21:24 -0400)]
rmg: provide a link to edit-a-ticket page to check versions
Ricardo Signes [Wed, 28 Aug 2013 01:15:14 +0000 (21:15 -0400)]
perlhist: 5.17.11 was missing!
Steve Hay [Wed, 28 Aug 2013 08:26:52 +0000 (09:26 +0100)]
perldelta - Fill in descriptions of module upgrades and new tests
Nicholas Clark [Fri, 23 Aug 2013 14:32:08 +0000 (16:32 +0200)]
Move the thrice-repeated "64bitint is buggy?" test from hints to Configure.
OpenBSD and its two* forks each have the same "is 64 bit int support buggy?"
test code as a callback unit duplicated in their hints files. As the code is
portable C, there seems to be no harm in moving it to Configure, and running
the test on all platforms. This reduces code duplication, and will reduce it
further if another OpenBSD fork appears.
* This week.
Nicholas Clark [Wed, 28 Aug 2013 08:47:42 +0000 (10:47 +0200)]
Only predeclare S_sv_or_pv_pos_u2b for -DPERL_CORE or -DPERL_EXT
Otherwise when compiling XS code, there is a declaration for a function
which is never used, which can cause some compilers to issue a warning.
Father Chrysostomos [Tue, 27 Aug 2013 20:00:24 +0000 (13:00 -0700)]
mg.h: Suppress compiler warning
GCC says:
pp_hot.c: In function 'Perl_pp_match':
pp_hot.c:1453: warning: signed and unsigned type in conditional expression
Reini Urban [Tue, 27 Aug 2013 16:32:02 +0000 (11:32 -0500)]
B::INVLIST isa B::PV (for now)
If the compiler stumbles over a B::INVLIST treat it as B::PV
and do not error.
Also restore rudimentary B versioning support for BIND and INVLIST.
Chris 'BinGOs' Williams [Tue, 27 Aug 2013 19:17:24 +0000 (20:17 +0100)]
Module-Build wasn't listed as DEPRECATED
Chris 'BinGOs' Williams [Tue, 27 Aug 2013 12:04:44 +0000 (13:04 +0100)]
Update ExtUtils-MakerMaker to CPAN version 6.74
[DELTA]
6.74 Tue Aug 27 12:43:05 BST 2013
No changes from 6.73_12
6.73_12 Fri Aug 23 10:49:13 BST 2013
Bug Fixes:
* Preserve runtime requires when PREREQ_PM argument is empty or undef
(miyagawa)
* RT#88037 regen run of Makefile.PL will use same -MCross arg as
initial .PL run (bulk88)
6.73_11 Sat Aug 17 22:51:14 BST 2013
Bug Fixes:
* RT#87911 prepend SUFFIX with a '.' if one isn't supplied
6.73_10 Fri Aug 16 16:40:09 BST 2013
Bug Fixes:
* RT#87839 resolve bootstrap problems when required prereqs
are missing
6.73_09 Fri Aug 9 19:58:32 BST 2013
Bug Fixes:
* Bundle code from Text::ParseWords to handle splitting
PERL_MM_OPT (actually removing Text::ParseWords this time).
6.73_08 Fri Aug 9 19:49:27 BST 2013
Bug Fixes:
* Bundle code from Text::ParseWords to handle splitting
PERL_MM_OPT.
6.73_07 Wed Aug 7 16:07:04 BST 2013
Bug Fixes:
* Set ACTIVEPERL_CONFIG_SILENT=1 during tests to make
ActivePerl less vocal about things
6.73_06 Tue Aug 6 00:50:08 BST 2013
New features:
* RT#70201 replace -M with Time::HiRes::stat
Bug Fixes:
* Split PERL_MM_OPT like a shell would, instead of split ' '
Win32 Fixes:
* Correct an oversight with Liblist Kid fix
6.73_05 Mon Aug 5 17:44:00 BST 2013
Win32 fixes:
* Fix hash randomisation problems with Liblist Kid
6.73_04 Thu Aug 1 22:34:31 BST 2013
Doc fixes:
* Corrected example for PM => {}
6.73_03 Tue Jul 30 22:09:52 BST 2013
Bug Fixes:
* Fix clean_subdirs target that was generating
warning on BSD
6.73_02 Fri Jul 26 13:32:43 BST 2013
Misc:
* Updated bundled Parse::CPAN::Meta
6.73_01 Wed Jul 24 23:49:56 BST 2013
Bug Fixes:
* Robustified parse_version()
Steve Hay [Tue, 27 Aug 2013 12:06:20 +0000 (13:06 +0100)]
perldelta - Start noting module upgrades and new test files
Steve Hay [Tue, 27 Aug 2013 12:05:47 +0000 (13:05 +0100)]
perldelta - Add missing =item directive
Father Chrysostomos [Tue, 27 Aug 2013 06:21:26 +0000 (23:21 -0700)]
[perl #119311] Keep CvDEPTH and savestack in sync
when unwinding sub and format calls.
The comments in the added test file explain what the problem is.
The fix is to call LEAVE_SCOPE in POPSUB and POPFORMAT (to free their
lexicals) before lowering CvDEPTH.
If the context has already been popped via cxstack_ix--, then
LEAVE_SCOPE could overwrite it, so accessing cx after LEAVE_SCOPE is
unsafe. Hence the changes to POPSUB and POPFORMAT are a bit involved.
Some callers of POPSUB do a temporary cxstack_ix++ first so they
can access cx afterwards. Two cases needed to be changed to
work that way.
Tony Cook [Tue, 27 Aug 2013 05:13:00 +0000 (15:13 +1000)]
[perl #119351] the test note isn't a note but an object description
avoid:
ok 239 - GV on a lexical sub isa B::SPECIAL isa B::SPECIAL
Ricardo Signes [Mon, 26 Aug 2013 21:55:28 +0000 (17:55 -0400)]
release schedule: Steve Hay will release in 2013-09
Tony Cook [Mon, 26 Aug 2013 06:41:20 +0000 (16:41 +1000)]
Tony Cook [Mon, 26 Aug 2013 06:32:48 +0000 (16:32 +1000)]
[perl #85104] save platform specific error code across signal handlers
This was previously done for VMS, add it (tested) for Win32 and
(untested) for OS/2.
Tony Cook [Mon, 26 Aug 2013 05:07:44 +0000 (15:07 +1000)]
[perl #85104] work harder to save error numbers
Updates the errno save macros to save the platform error number where
needed for more than just VMS.
The OS/2 code is untested.
Tony Cook [Mon, 26 Aug 2013 05:32:36 +0000 (15:32 +1000)]
[perl #85104] TODO test for preserving $^E across signal handlers
and tests Win32 signal emulation too
Tony Cook [Mon, 26 Aug 2013 04:35:17 +0000 (14:35 +1000)]
Tony Cook [Mon, 26 Aug 2013 04:34:41 +0000 (14:34 +1000)]
fix a type in the find2perl perldelta entry
Tony Cook [Mon, 26 Aug 2013 01:26:19 +0000 (11:26 +1000)]
[perl #117265] safesyscalls: check embedded nul in syscall args
Check for the nul char in pathnames and string arguments to
syscalls, return undef and set errno to ENOENT.
Added to the io warnings category syscalls.
Strings with embedded \0 chars were prev. ignored in the syscall but
kept in perl. The hidden payloads in these invalid string args may cause
unnoticed security problems, as they are hard to detect, ignored by
the syscalls but kept around in perl PVs.
Allow an ending \0 though, as several modules add a \0 to
such strings without adjusting the length.
This is based on a change originally by Reini Urban, but pretty much
all of the code has been replaced.
Tony Cook [Mon, 26 Aug 2013 01:35:21 +0000 (11:35 +1000)]
[perl #119351] update the test note for the changed B::CV::GV test
Tony Cook [Sun, 25 Aug 2013 23:26:15 +0000 (09:26 +1000)]
Tony Cook [Sun, 25 Aug 2013 23:04:47 +0000 (09:04 +1000)]
[perl #119351] fix regression in B::CV::GV
The fix for [perl #118525] introduced a regression in the behavior of
B::CV::GV.
Previously it would return a B::SPECIAL when the GV slot was NULL, the
incorrect fix changed it to return undef.
This change fixes B::CV::GV to return a B::SPECIAL for NULL for both
B::main_cv and for B::CV objects created from lexical subs.
Tony Cook [Sun, 25 Aug 2013 23:03:56 +0000 (09:03 +1000)]
bump B to 1.46
Tony Cook [Wed, 21 Aug 2013 23:38:24 +0000 (09:38 +1000)]
[perl #119351] fix B::CV::GV to return a B::SPECIAL on NULL
Father Chrysostomos [Sun, 25 Aug 2013 20:20:57 +0000 (13:20 -0700)]
Increase $re::VERSION to 0.26
Father Chrysostomos [Sun, 25 Aug 2013 20:18:45 +0000 (13:18 -0700)]
Correct sub signature in re.xs
Father Chrysostomos [Fri, 26 Jul 2013 08:26:54 +0000 (01:26 -0700)]
Fix assert fail when fetching pos clobbers ref with undef
pos($x) returns a special magical scalar that sets the match position
on $x. Calling pos($x) twice will provide two such scalars. If we
set one of them to a reference, set the other to undef, and then read
the first, all hail breaks loose, because of the use of SvOK_off.
SvOK_off is not sufficient if arbitrary values can be assigned by Perl
code. Globs, refs and regexps (among others) need special handling,
which sv_setsv knows how to do.
Father Chrysostomos [Fri, 26 Jul 2013 01:08:23 +0000 (18:08 -0700)]
Stop values from ‘sticking’ to @- and @+ elems
These arrays are very similar to tied arrays, in that the elements are
created on the fly when looked up. So push @_, \$+[0], \$+[0], will
push references to two different scalars on to @_.
That they are created on the fly prevents this bug from showing up
in most code: If you reference the element you can observe that, on
FETCH, it gets set to the corresponding offset *if* the last match has
a set of capturing parentheses with the right number. Otherwise, the
value in the element is left as-is.
So, doing another pattern match with, say, 5 captures and then another
with fewer will leave $+[5] and $-[5] holding values from the first
match, if there is a FETCH in between the two matches:
$ perl -le '" "=~/()()()()(..)/; $_ = \$+[5]; print $$_; ""=~ /()/; print $$_;'
2
2
And attempts at assignment will succeed, even though they croak:
$ perl -le 'for ($-[0]) { eval { $_ = *foo }; print $_ }'
*main::foo
The solution here is to make the magic ‘get’ handler set the SV
no matter what, instead of just setting it when it refers to a
valid offset.
Father Chrysostomos [Thu, 25 Jul 2013 01:14:06 +0000 (18:14 -0700)]
pp_hot.c: Show lengths in -Dr output for minlen optimisation
Father Chrysostomos [Sun, 25 Aug 2013 19:24:04 +0000 (12:24 -0700)]
[Merge] Regexp long string support
Father Chrysostomos [Sun, 18 Aug 2013 21:03:06 +0000 (14:03 -0700)]
Use SSize_t/STRLEN in more places in regexp code
As part of getting the regexp engine to handle long strings, this com-
mit changes any variables, parameters and struct members that hold
lengths of the string being matched against (or parts thereof) to use
SSize_t or STRLEN instead of [IU]32.
To avoid having to change any logic, I kept the signedness the same.
I did not change anything that affects the length of the regular
expression itself, so regexps are still practically limited to
I32_MAX. Changing that would involve changing the size of regnodes,
which would be a lot more involved.
These changes should fix bugs, but are very hard to test. In most
cases, I don’t know the regexp engine well enough to come up with test
cases that test the paths in question with long strings. In other
cases I don’t have a box with enough memory to test the fix.
Father Chrysostomos [Wed, 31 Jul 2013 06:49:58 +0000 (23:49 -0700)]
Stop substr re optimisation from rejecting long strs
Using I32 for the fields that record information about the location of
a fixed string that must be found for a regular expression to match
can result in match failures, because I32 is not large enough to store
offsets >= 2**31.
SSize_t is appropriate, since it is 64 bits on 64-bit platforms and 32
bits on 32-bit platforms.
This commit changes enough instances of I32 to SSize_t to get the
added test passing and suppress compiler warnings. A later commit
will change many more.
Father Chrysostomos [Thu, 25 Jul 2013 23:52:59 +0000 (16:52 -0700)]
Make @- and @+ return correct offsets beyond 2**31
Father Chrysostomos [Thu, 25 Jul 2013 23:41:01 +0000 (16:41 -0700)]
Make $' work past the 2**31 threshold
Father Chrysostomos [Thu, 25 Jul 2013 07:41:07 +0000 (00:41 -0700)]
[perl #116907] Allow //g matching past 2**31 threshold
Change the internal fields for storing positions so that //g in scalar
context can move past the 2**31 character threshold. Before this com-
mit, the numbers would wrap, resulting in assertion failures.
The changes in this commit are only enough to get the added test pass-
ing. Stay tuned for more.
Father Chrysostomos [Wed, 24 Jul 2013 21:23:54 +0000 (14:23 -0700)]
Stop minlen regexp optimisation from rejecting long strings
This fixes #112790 and part of #116907.
The length of the string is cast to I32, so it wraps and end up less
than the minimum length.
For now, simply skip this optimisation if minlen itself wraps and
becomes negative.
Father Chrysostomos [Sat, 27 Jul 2013 14:10:08 +0000 (07:10 -0700)]
regexec.c:regexec_flags: Remove unused var
This variable, end_shift, only ever holds the value 0. It is used in
only one place, where its value is assigned to another variable.
The history is interesting:
start_shift and end_shift were added in
c277df42229, which added sub-
string optimisations.
146174a91a192 rearranged stuff a bit, causing
these variables to be unused.
155aba94f6 commented out the unused
start_shift to suppress a compiler warning.
1df70142a966e remove=
the start_shift comment, leaving the comment describing end_shift
nonsensical.
Father Chrysostomos [Tue, 23 Jul 2013 20:15:34 +0000 (13:15 -0700)]
Stop pos() from being confused by changing utf8ness
The value of pos() is stored as a byte offset. If it is stored on a
tied variable or a reference (or glob), then the stringification could
change, resulting in pos() now pointing to a different character off-
set or pointing to the middle of a character:
$ ./perl -Ilib -le '$x = bless [], chr 256; pos $x=1; bless $x, a; print pos $x'
2
$ ./perl -Ilib -le '$x = bless [], chr 256; pos $x=1; bless $x, "\x{1000}"; print pos $x'
Malformed UTF-8 character (unexpected end of string) in match position at -e line 1.
0
So pos() should be stored as a character offset.
The regular expression engine expects byte offsets always, so allow it
to store bytes when possible (a pure non-magical string) but use char-
acters otherwise.
This does result in more complexity than I should like, but the alter-
native (always storing a character offset) would slow down regular
expressions, which is a big no-no.