Chris 'BinGOs' Williams [Tue, 7 Dec 2010 13:25:37 +0000 (13:25 +0000)]
Update ExtUtils-CBuilder to CPAN version 0.2800
[DELTA]
0.2800 - Mon Dec 6 16:05:46 EST 2010
- No changes from 0.27_07
0.27_07 - Wed Sep 29 21:48:55 EDT 2010
Fixed:
- Fixed t/02-link.t on perl < 5.8
0.27_06 - Mon Sep 27 15:29:54 EDT 2010
Fixed:
- Preserves exit status on VMS [Craig Berry]
- Fix Win32 split_like_shell escaping [Christian Walde]
0.27_05 - Wed Jul 28 15:29:59 EDT 2010
Fixed:
- Tests no longer fail if user has set the CC environment variable
0.27_04 - Mon Jul 26 22:41:43 EDT 2010
Added:
- handle c compiler and c++ compiler separately
(adds requirement for IPC::Cmd) [Jens Rehsack]
Others:
- rely on File::Temp::tempfile and File::Spec::tmpdir to
get unique file name for checking for compiler
[Jens Rehsack]
- Code base modernization and substantial code coverage improvments
[Jim Keenan]
Florian Ragwitz [Tue, 7 Dec 2010 12:42:45 +0000 (13:42 +0100)]
Perldelta for 22a3069
As contributed by Zefram on irc, with some pod markup added.
Jan Dubois [Tue, 7 Dec 2010 02:16:39 +0000 (18:16 -0800)]
Get rid of PERL_MSVCRT_READFIX
The code works around a bug in very old versions of MSVCRT.dll.
The issue has been fixed a long time ago by Microsoft, so anyone
who has installed a Windows Service Pack in the last 10 years
or so won't be affected by the problem.
Jan Dubois [Tue, 7 Dec 2010 01:13:37 +0000 (17:13 -0800)]
Remove dead Windows code
Zefram [Mon, 6 Dec 2010 22:21:19 +0000 (22:21 +0000)]
stopgap hack for $@ as unwinding reason indicator
Set $@ early in a die as well as late, so that it continues to function
as an unreliable indicator of whether unwinding in progress is due to
an exception. This is a stopgap arrangement, until the unwinding process
can be introspected properly.
David Golden [Mon, 6 Dec 2010 20:41:20 +0000 (15:41 -0500)]
Clarify this is the Perl 5 interpreter for manpage and META
Karl Williamson [Sun, 5 Dec 2010 23:13:59 +0000 (16:13 -0700)]
regcomp.c: Fix longjmp-related warnings
This patch should get rid of the compiler warnings recently introduced.
Another way to handle the pm_flags warning is to declare it to be
volatile, but not all compilers that perl uses apparently have that, so
I chose a longer way of introducting a new variable that isn't changed
within the jumpable area. The others were fixed by not initializing
them before the jumpable area.
Father Chrysostomos [Sun, 5 Dec 2010 03:27:27 +0000 (19:27 -0800)]
To-do tests for abnormal exiting from (?{})
Father Chrysostomos [Sun, 5 Dec 2010 02:11:24 +0000 (18:11 -0800)]
Hideous to-do tests for (?{}) scoping issues
Father Chrysostomos [Sat, 4 Dec 2010 20:43:06 +0000 (12:43 -0800)]
Un-TODO and un-SKIP the [perl #22354] tests
We can run these now that the regexp engine is reëntrant.
Father Chrysostomos [Sat, 4 Dec 2010 20:38:38 +0000 (12:38 -0800)]
Emit warning for use re "/ul"
This was an omission on my part.
This should perhaps be an error, but I am just following what
‘use re’ already does with ‘use re "whatever"’.
Karl Williamson [Sat, 4 Dec 2010 18:18:23 +0000 (11:18 -0700)]
regexec.c: Clean up initialized vars in switch
Commit
cf5c578b88887f19f7fba519bbc12296 attempted to clean up
d7ef4b73,
but did not get it quite right. This fixes it, after consultation with
the author.
Karl Williamson [Fri, 3 Dec 2010 17:46:19 +0000 (10:46 -0700)]
regcomp.c: small efficiency, portability fix
The code had hard-coded into it the ascii platform values for possible
start bytes. There are macros that do that portably with no branches
Karl Williamson [Fri, 3 Dec 2010 17:44:55 +0000 (10:44 -0700)]
regcomp.c: small efficiency improvement
The inline function repeats the test removed here.
Karl Williamson [Fri, 3 Dec 2010 17:36:22 +0000 (10:36 -0700)]
regcomp.c: small efficiency gain
The 7-bit test operations always fail on non-ascii characters, therefore
it isn't needed to test each such character individually. The loops
that do that and then set a bit for each character can therefore stop at
127 instead of 255 (the bitmaps are initialized to all zeros). For
EBCDIC, the same applies, except that we have to map those 7-bits
characters to the 8-bit EBCDIC range. This creates an extra array
lookup for each ebcdic character, but half as many times through the
loop.
For the complement of the 7-bit operations, we know that they will all
be set for the non-ascii characters. Therefore, we don't need to test,
we can just unconditionally set those bits. It would not be a good idea
to just do a memset on that range under /i, as each character that gets
chosen may have its fold added as well and that has to be looked up
individually.
Karl Williamson [Fri, 3 Dec 2010 16:32:14 +0000 (09:32 -0700)]
regecomp, regexec: Use mnemonic character names
This patch replaces hex ordinals by macros containing the character
names, for clarity and portability to EBCDIC.
Karl Williamson [Fri, 3 Dec 2010 16:15:59 +0000 (09:15 -0700)]
utf8.h: Need to make sure macro result fits in byte
The UTF8_TWO_BYTE_HI_nocast() macro has an error in it, in that the
START_MARK is larger than a byte, and only the last 8 bits of it are
relevant. This hasn't caused a problem because the macro hasn't been
called directly, but from other macros that make sure the result gets
cast to a U8.
Karl Williamson [Fri, 3 Dec 2010 16:15:22 +0000 (09:15 -0700)]
utf8.h: Add whitespace for readability
Karl Williamson [Fri, 3 Dec 2010 15:54:37 +0000 (08:54 -0700)]
regcomp.c: Move code out of longjump area
This code should be done before the setjump to avoid the longjump
clobbering it.
Peter J. Holzer [Sat, 4 Dec 2010 19:40:23 +0000 (11:40 -0800)]
[perl #80220] order of hash keys wrong in perlfunc.pod
Father Chrysostomos [Sat, 4 Dec 2010 19:39:16 +0000 (11:39 -0800)]
Add Peter Holzer to AUTHORS
David Leadbeater [Fri, 3 Dec 2010 14:09:19 +0000 (14:09 +0000)]
perldelta for Storable saving a code reference as UTF-8
David Leadbeater [Fri, 3 Dec 2010 14:16:38 +0000 (14:16 +0000)]
Up Storable version to 2.25
David Leadbeater [Fri, 3 Dec 2010 09:20:52 +0000 (09:20 +0000)]
Up Storable minor version
The change for storing UTF-8 coderefs necessitates this change.
David Leadbeater [Fri, 3 Dec 2010 09:01:55 +0000 (09:01 +0000)]
Make Storable correctly store coderefs with UTF-8 flag
Yves Orton [Sat, 4 Dec 2010 14:26:38 +0000 (15:26 +0100)]
make empty string regexp stringify to the same thing regardless of unicode flags
Yves Orton [Sat, 4 Dec 2010 13:48:13 +0000 (14:48 +0100)]
make the jump point a little more obvious in a comment
Nicholas Clark [Fri, 3 Dec 2010 21:07:17 +0000 (21:07 +0000)]
Remove the Makefile command to touch perlmain.c after running makedepend.
Jerry D. Hedden was right to question whether this was now superfluous, because
as best I can tell it was *always* superfluous. Perl 5.000 shipped with a
Makefile rule to build perlmain.c using a shell script, with a dependency for
perlmain.c on makefile. [Lowercase makefile, now abstracted as $(FIRSTMAKEFILE).
This is generated by makedepend from Makefile, by calculating the dependency
rules to append to it.] The rule to generate perlmain.c had a prerequisite on
$(FIRSTMAKEFILE), and in turn $(FIRSTMAKEFILE) has a dependency on $(c), which
included perlmain.c. Hence there was a circular dependency, and the "solution"
to avoiding repeated rebuilds was to touch perlmain.c (if it exists), after
running makedepend.
As best I can tell there is no *actual* dependency for the correct generation
of perlmain.c on the contents of $(FIRSTMAKEFILE), as the relevant variables
are the same in both Makefile and $(FIRSTMAKEFILE). Hence this command should
have been removed, along with the dependency, years ago. However, no-one
spotted this until Jerry observed that
fbcaf61123069fe4 changed the build
rules, and removed the dependency, but not the touch command.
Michael Breen [Tue, 30 Nov 2010 17:48:50 +0000 (17:48 +0000)]
[perl #71286] fallback/nomethod failures
This fixes two bugs related to overload and fallback on binary ops.
First, if *either* of the args has a 'nomethod', this will now be used;
previously the RH nomethod was ignored if the LH arg had fallback value
of undef or 1.
Second, if neither arg has a 'nomethod', then the fallback to the built-in
op will now only occur if *both* args have fallback => 1; previously it
would do so if the *RHS* had fallback => 1. Clearly the old behaviour was
wrong, but there were two ways to fix this: (a) *both* args have fallback
=> 1; (b) *either* arg has fallback=> 1. It could be argued either way,
but the the choice of 'both' was that classes that hadn't set 'fallback =>
1' were implicitly implying that their objects aren't suitable for
fallback, regardless of the presence of conversion methods.
Florian Ragwitz [Fri, 3 Dec 2010 11:43:25 +0000 (12:43 +0100)]
This commit doesn't really need a delta entry
Craig A. Berry [Fri, 3 Dec 2010 04:24:21 +0000 (22:24 -0600)]
Remove lots of unused, VMS-specific variables.
Brought to you by -Duser_c_flags=/WARN=(ENABLE=LEVEL5,INFORMATIONAL=ALL)
Craig A. Berry [Fri, 3 Dec 2010 04:20:41 +0000 (22:20 -0600)]
Fix K&R-style function declaration.
Craig A. Berry [Fri, 3 Dec 2010 04:19:04 +0000 (22:19 -0600)]
Remove unused include file from vms/vms.c.
Father Chrysostomos [Fri, 3 Dec 2010 02:02:06 +0000 (18:02 -0800)]
Document the explicit * in tie *$handle
Father Chrysostomos [Fri, 3 Dec 2010 01:51:44 +0000 (17:51 -0800)]
perldelta for the tie $handle changes
Father Chrysostomos [Thu, 2 Dec 2010 17:52:36 +0000 (09:52 -0800)]
Deprecate tie $handle without *
Father Chrysostomos [Thu, 2 Dec 2010 17:38:02 +0000 (09:38 -0800)]
Fix up tests to work around tie $handle
Father Chrysostomos [Thu, 2 Dec 2010 17:36:48 +0000 (09:36 -0800)]
Revert "[perl #77496] tied gets scalars and globs confused"
This reverts commit
8752206e276cffe588c0932b5a9f2331640e8447.
Father Chrysostomos [Thu, 2 Dec 2010 17:36:41 +0000 (09:36 -0800)]
Revert "[perl #77688] tie $scalar can tie a handle"
This reverts commit
9aa8b00892d81bb5e94565d3cb9841dd57b7b9cf.
Father Chrysostomos [Thu, 2 Dec 2010 17:36:35 +0000 (09:36 -0800)]
Revert "Make untie check the FAKE flag on globs"
This reverts commit
830748013f81bcc28d145baf4024efd1b6537704.
Jan Dubois [Thu, 2 Dec 2010 20:10:44 +0000 (12:10 -0800)]
Windows 95 Chainsaw Massacre
Remove all supporting code for Windows 9x and Windows NT. The
minimum supported version is Windows 2000 now.
Craig A. Berry [Thu, 2 Dec 2010 20:44:15 +0000 (14:44 -0600)]
Fix some unreachable and return nits in vms/vms.c.
Craig A. Berry [Thu, 2 Dec 2010 20:33:46 +0000 (14:33 -0600)]
Fix some =/== nits in vms/vms.c
Father Chrysostomos [Thu, 2 Dec 2010 16:30:51 +0000 (08:30 -0800)]
[perl #80098] Bleadperl breaks Attribute::Lexical
If
@UNIVERSAL::ISA = "a";
and
@a::ISA = "b";
then methods are searched for in these orders:
main UNIVERSAL a b
UNIVERSAL a b UNIVERSAL a b
a b UNIVERSAL a b
b UNIVERSAL a b
For method lookup, looking at a stash twice causes no problems (except
for a SUPER bug I’ve just found--to be dealt with separately).
My fix to next::method in a5cd004 which made it do a second pass with
UNIVERSAL the way gv_fetchmeth does did not take into account that it
might return its caller (sub a::foo { return shift->next::can }),
causing an infinite loop.
This patch makes it check, on the second pass, whether each stash is
the stash at the start of the MRO list and breaks if that is the case,
so the MROs are effectively:
main UNIVERSAL a b
UNIVERSAL a b
a b UNIVERSAL
b UNIVERSAL a
(which is what they are effectively already for method lookup).
Chris 'BinGOs' Williams [Thu, 2 Dec 2010 15:41:45 +0000 (15:41 +0000)]
Update Locale-Codes to CPAN version 3.15
[DELTA]
3.15 2010-12-02 sbeck
* NEW CODE(s)
* Added version number to Makefile.PL/Build.PL requirement
for POD testing modules. RT 62247
* Changed 'use vars' to 'our'
Tony Cook [Thu, 2 Dec 2010 12:03:57 +0000 (23:03 +1100)]
Fix C++ breakage introduced in
d7ef4b73
C++ doesn't allow goto or switch to bypass initialized variable
declarations. Also fix the function pointer type.
Karl Williamson [Wed, 1 Dec 2010 23:36:44 +0000 (16:36 -0700)]
Nit in perluniintro.pod
Karl Williamson [Wed, 1 Dec 2010 23:34:58 +0000 (16:34 -0700)]
Nit in perlunicode.pod
Karl Williamson [Wed, 1 Dec 2010 23:34:25 +0000 (16:34 -0700)]
Nit in perlre.pod
Karl Williamson [Wed, 1 Dec 2010 23:33:54 +0000 (16:33 -0700)]
Document Unicode doc fix
Karl Williamson [Wed, 1 Dec 2010 23:15:18 +0000 (16:15 -0700)]
Nit in perlunicode.pod
Karl Williamson [Wed, 1 Dec 2010 05:58:37 +0000 (22:58 -0700)]
re/fold_grind.t: Add tests for NREFFU, REFFU
This adds simple tests for these. Inspection of the code indicated to
me that more complex tests were not warranted.
Karl Williamson [Wed, 1 Dec 2010 05:35:13 +0000 (22:35 -0700)]
regcomp.c: Generate REFFU and NREFFU
This causes the new nodes that denote Unicode semantics in
backreferences to be generated when appropriate.
Because the addition of these nodes was at the end of the node list, the
arithmetic relation that previously was valid no longer is.
Karl Williamson [Wed, 1 Dec 2010 05:05:25 +0000 (22:05 -0700)]
regexec.c: Handle REFFU and NREFFU; refactor
This adds handling of the Unicode folding semantics capture buffer
backreferences. I've refactored the code so that the case statements
set up the type of folding, to avoid having to test for which in the
common code.
Also, the previous code was confusing fold case and lowercase. There is
already a routine to handle the fold case, so that simplified things.
Karl Williamson [Wed, 1 Dec 2010 04:49:20 +0000 (21:49 -0700)]
re/fold_grind.t: Refactor to test utf8 patterns.
The previous version wasn't really testing utf8 patterns.
Karl Williamson [Wed, 1 Dec 2010 04:39:16 +0000 (21:39 -0700)]
regcomp.sym: Add REFFU and NREFFU nodes
These will be used for matching capture buffers case-insensitively using
Unicode semantics.
make regen will regenerate the delivered regnodes.h
Karl Williamson [Wed, 1 Dec 2010 04:38:09 +0000 (21:38 -0700)]
regcomp.sym: update comment
Karl Williamson [Wed, 1 Dec 2010 02:00:00 +0000 (19:00 -0700)]
regcomp.c: Use latin1 folding in synthetic start class
This is because the pattern may not specify unicode semantics, but if
the target matching string is in utf8, then unicode semantics may be
needed nonetheless. So to avoid the regexec optimizer rejecting the
match, we need to allow for a possible false positive.
Karl Williamson [Wed, 1 Dec 2010 01:10:37 +0000 (18:10 -0700)]
regcomp.c: utf8 pattern defaults to Unicode semantics
A utf8 pattern should force unicode semantics unless otherwise
overridden. This means that the 'd' regex modifier means Unicode
semantics as well.
Karl Williamson [Wed, 1 Dec 2010 00:48:22 +0000 (17:48 -0700)]
regcomp.c: teach tries about EXACTFU
Karl Williamson [Wed, 1 Dec 2010 00:45:54 +0000 (17:45 -0700)]
regcomp.c: typo in comment
Karl Williamson [Wed, 1 Dec 2010 00:43:35 +0000 (17:43 -0700)]
re/reg_fold.t: use array size for test counts
Karl Williamson [Tue, 30 Nov 2010 21:02:08 +0000 (14:02 -0700)]
regcomp.c: Remove duplicate statement
The flags this statement cleared are cleared as part of the macro called
just before it.
Father Chrysostomos [Wed, 1 Dec 2010 22:44:01 +0000 (14:44 -0800)]
[perl #64792] Document $? in perlfunc/exit
Florian Ragwitz [Wed, 1 Dec 2010 16:19:10 +0000 (17:19 +0100)]
Upgrade if from version 0.06 to 0.0601
Jerry D. Hedden [Wed, 1 Dec 2010 15:32:34 +0000 (10:32 -0500)]
Fix compiler warning in hv.c on MSWin32
Fixes the following seen in a Steve Hay smoke test:
Compiler messages(MSWin32):
..\hv.c(1646) : warning C4244: 'initializing' : conversion from 'unsigned long ' to 'const char ', possible loss of data
Jerry D. Hedden [Wed, 1 Dec 2010 14:51:43 +0000 (09:51 -0500)]
Fix uninit compiler warning in mro.c
Father Chrysostomos [Wed, 1 Dec 2010 13:47:01 +0000 (05:47 -0800)]
perldelta up to
6b7c6d959
Father Chrysostomos [Wed, 1 Dec 2010 13:33:45 +0000 (05:33 -0800)]
perldelta for [perl #68654]
Father Chrysostomos [Wed, 1 Dec 2010 06:36:52 +0000 (22:36 -0800)]
++substr $mro'VERSION, -1
Father Chrysostomos [Wed, 1 Dec 2010 06:35:16 +0000 (22:35 -0800)]
[perl #68654] next::method doesn't see UNIVERSAL
This commit makes next::method retry with UNIVERSAL if it reaches the
end of the MRO list.
Father Chrysostomos [Wed, 1 Dec 2010 06:31:41 +0000 (22:31 -0800)]
Make next_edgecases.t easier to deal with
This makes ./perl -Ilib t/mro/next_edgecases.t work and also
allows test functions to be called without parentheses.
Nicholas Clark [Wed, 1 Dec 2010 10:23:27 +0000 (10:23 +0000)]
Avoid two compiler warnings in B::cstring, spotted by Steve Hay's smoker.
Chris 'BinGOs' Williams [Wed, 1 Dec 2010 10:29:59 +0000 (10:29 +0000)]
Update Maintainers.pl for the CPAN'd version of Module-CoreList
Florian Ragwitz [Wed, 1 Dec 2010 10:08:16 +0000 (11:08 +0100)]
Fix B test failure introduced in 6b7c6d9
Father Chrysostomos [Wed, 1 Dec 2010 05:32:38 +0000 (21:32 -0800)]
Jerry D. Hedden [Tue, 30 Nov 2010 23:22:35 +0000 (18:22 -0500)]
Skip t/io/eintr.t on Cygwin, too - hangs
Father Chrysostomos [Tue, 30 Nov 2010 23:53:16 +0000 (15:53 -0800)]
Fix memory leak in hfreeentries
The change that made hfreeentries keep the name in place when iterat-
ing (
2d0d1ecc) caused this statement at the end of the loop to be a
no-op for named hashes, because the HvARRAY is always present at the
end of the loop (it contains the name):
if (!HvARRAY(hv)) {
/* Good. No-one added anything this time round. */
break;
}
So this line was added (by the same change) before the freeing of the
linked lists:
/* If there are no keys, there is nothing left to free. */
if (!((XPVHV*) SvANY(hv))->xhv_keys) break;
But that means that this, immediately after the freeing of the linked
lists and just before the if(!HvARRAY(hv)):
if (array != orig_array) {
Safefree(array);
}
was not being reached, resulting in a memory leak (that Nicholas
Clark found).
This is what would happen:
On entering hfreeentries, orig_array would be assigned the value
in HvARRAY.
HvARRAY = original array
orig_array = original array
Then the main loop would be entered, which would assign
HvARRAY to array:
HvARRAY = original array
orig_array = original array
array = original array
HvARRAY would be nulled out and assigned a new value by hv_auxinit:
HvARRAY = first new array
orig_array = original array
array = original array
Then the loop would repeat:
HvARRAY = first new array
orig_array = original array
array = first new array
Then the HvARRAY would once more be nulled and replaced via
hv_auxinit:
HvARRAY = second new array
orig_array = original array
array = first new array
Then the if(no keys)break; statement would be reached, exit-
ing the loop:
HvARRAY = second new array
orig_array = original array
<nothing> = first new array
So the first new array is never freed.
This commit skips the allocation of an extra array at the beginning of
the loop if there are no keys. Then it exits early at the same spot.
Florian Ragwitz [Tue, 30 Nov 2010 16:49:27 +0000 (17:49 +0100)]
perldelta for mg_findext and sv_unmagicext
Father Chrysostomos [Tue, 30 Nov 2010 16:33:50 +0000 (08:33 -0800)]
Suppress warning from t/op/attrs.t
Father Chrysostomos [Tue, 30 Nov 2010 13:54:23 +0000 (05:54 -0800)]
[perl #77762] Constant assignment warning
With this patch:
$ ./perl -we 'sub A () {1}; if (0) {my $foo = A or die}'
$ ./perl -we 'sub A () {1}; if (0) {my $foo = 1 or die}'
Found = in conditional, should be == at -e line 1.
Since the value of a constant may not be known at the time the program
is written, it should be perfectly acceptable to do a constant assign-
ment in a conditional.
Nicholas Clark [Tue, 30 Nov 2010 15:51:10 +0000 (15:51 +0000)]
Restore building Encode's subextensions for a static build.
The special-casing in Configure still referred to ext/Encode, so likely this
was broken when Encode moved to cpan/
Fixes #79494, reported by Marc Lehmann.
Nicholas Clark [Tue, 30 Nov 2010 13:16:11 +0000 (13:16 +0000)]
In S_scan_const(), use my_snprintf() instead of my_sprintf().
Paranoid linkers warn about using sprintf(), and rightly so.
Father Chrysostomos [Tue, 30 Nov 2010 13:01:25 +0000 (05:01 -0800)]
Use ' to avoid interpolation
Nick Cleaton [Tue, 30 Nov 2010 06:26:43 +0000 (22:26 -0800)]
[perl #79152] super-linear cache can prevent a valid match
The super-linear cache in regexec.c can prevent a valid match
from being detected. For example:
print "yay\n" if 'xayxay' =~ /(q1|.)*(q2|.)*(x(a|bc)*y){2,}/;
This should match, but it doesn't because the cache fails to
distinguish between matching the final xay to x(a|bc)*y as the
first instance of the {2,} and matching it in the same position
as the second instance.
This seems to do the trick.
Peter John Acklam [Mon, 29 Nov 2010 15:00:07 +0000 (16:00 +0100)]
Spelling: reminder -> remainder
Florian Ragwitz [Thu, 25 Nov 2010 01:53:40 +0000 (02:53 +0100)]
Update perlguts for sv_unmagicext and mg_findext
Florian Ragwitz [Thu, 25 Nov 2010 01:40:16 +0000 (02:40 +0100)]
Add tests for sv_{,un}magicext and mg_findext
Florian Ragwitz [Thu, 25 Nov 2010 01:40:00 +0000 (02:40 +0100)]
Add mg_findext
Florian Ragwitz [Thu, 25 Nov 2010 00:06:27 +0000 (01:06 +0100)]
Add sv_unmagicext
Florian Ragwitz [Tue, 30 Nov 2010 09:24:26 +0000 (10:24 +0100)]
Eliminate strlen and strEQ usage in gv_fetchmethod
This commit brought to you with the aid of the campaign for elimination of
strlen().
Father Chrysostomos [Tue, 30 Nov 2010 06:23:12 +0000 (22:23 -0800)]
Another oops.
Something else changed unnecessarily by
541ed3a9. I really oughtn’t do
this when I’ve been awake for more than 18 hours....
Father Chrysostomos [Tue, 30 Nov 2010 05:56:25 +0000 (21:56 -0800)]
Oops.
That was part of my first attempt to fix [perl #68560]. I forgot to
delete it. (It’s harmless.)
Father Chrysostomos [Tue, 30 Nov 2010 05:50:59 +0000 (21:50 -0800)]
perldelta entry for [perl #68560]
Father Chrysostomos [Tue, 30 Nov 2010 05:43:52 +0000 (21:43 -0800)]
[perl #68560] calling closure prototype SEGVs
When a closure is created, the original sub is cloned (except that the
op tree is shared). That original sub (called the closure prototype)
is not usually accessible to perl.
An attribute handler (MODIFY_CODE_ATTRIBUTES) is passed a reference
to it, however. If that code reference is called within the attribute
handler, an ‘Undefined subroutine called’ error results, because the
op tree has not been attached yet.
If that code reference is stashed away and called after the attribute
handler returns, it will most likely crash.
This is because its pad is full of nulls.
A regular $proto->() or &$proto() call that sets up @_ will crash in
attempting to do so.
A &$proto call will bypass that, but attempting to read any lexical
variables from the containing scope will cause a crash. Any operator
that uses TARG (i.e., most of them) will crash.
So this commit puts a check for closure prototypes in pp_entersub. It
produces a new error message, ‘Closure prototype called’.
This does introduce a backward-incompatible change: code like this
used to work:
sub MODIFY_CODE_ATTRIBUTES { $'proto = $_[1] }
{ my $x; () = sub :attr { () = $x; print "hello\n" } }
&$'proto;
But writing a useful subroutine that tiptoes past the crashes is so
difficult that I think this breakage is acceptable.
Jan Dubois [Tue, 30 Nov 2010 01:10:02 +0000 (17:10 -0800)]
Use default stack size on Windows
Perl used to request 16MB of stack instead of the default 1MB (when
compiling with VC++). I believe this was done to accomodate the
recursive nature of the regex engine, which is no longer a concern
since 5.10. The requested stack size will be reserved for each
thread created by the process, not just for the main thread.
Note also that we don't explicitly specify the stack size when
compiling with GCC on Windows (MinGW), which reserves a stack size of
2MB by default.
Chris 'BinGOs' Williams [Mon, 29 Nov 2010 22:14:25 +0000 (22:14 +0000)]
Change the default for usemymalloc to 'n' for NetBSD
It should not be the default, it isn't the default when perl is
built in pkgsrc and from personal experience using perl's malloc
as the default is to enter a world of pain and suffering.
David Golden [Mon, 29 Nov 2010 04:12:12 +0000 (23:12 -0500)]
Filehandle method calls load IO::File on demand
When a method call on a filehandle would die because the method can not
be resolved and L<IO::File> has not been loaded, Perl now loads IO::File
via C<require> and attempts method resolution again:
open my $fh, ">", $file;
$fh->binmode(":raw"); # loads IO::File and succeeds
This also works for globs like STDOUT, STDERR and STDIN:
STDOUT->autoflush(1);
Because this on-demand load only happens if method resolution fails, the
legacy approach of manually loading an IO::File parent class for partial
method support still works as expected:
use IO::Handle;
open my $fh, ">", $file;
$fh->autoflush(1); # IO::File not loaded
Nicholas Clark [Mon, 29 Nov 2010 19:19:21 +0000 (19:19 +0000)]
Following
fbcaf61123069fe4, remove perlmain.c from the initial list of C files.
Otherwise miniperl gets built by ./makedepend, as it calls `make clist`,
clist depends on the initial list of C files, and perlmain.c has rules to
(re)build it which depend on miniperl.
There is no dependency problem with removing perlmain.c from the list of C
files, and hence the list of files for which makefile dependency rules are
generated, as its (new) dependency on miniperl means that it will always be
rebuilt if miniperl is rebuilt, and in turn miniperl will always be rebuilt
it miniperlmain.o is out of date. perlmain.o has the same dependencies as
miniperlmain.o, so the requirement to rebuild is always satisfied.
Thanks to Florian Ragwitz for spotting this problem.
Florian Ragwitz [Mon, 29 Nov 2010 18:37:25 +0000 (19:37 +0100)]
Fix a typo in perlmod