Tony Cook [Sun, 8 Jul 2012 03:00:42 +0000 (13:00 +1000)]
fix -Uusedl builds
without the "static" linking produced a duplicate symbol error on
S_compile_runtime_code
Tony Cook [Sun, 8 Jul 2012 01:24:33 +0000 (11:24 +1000)]
perldelta: fix typo noticed by rurban
Father Chrysostomos [Sat, 7 Jul 2012 04:57:39 +0000 (21:57 -0700)]
[perl #113016] Parse CORE::foo::bar as a bareword
CORE::print::foo was being parsed as CORE::print followed by
::foo, making it impossible to call a global override directly as
CORE::GLOBAL::uc().
The logic in toke.c that does the CORE:: special-casing was faulty.
This commit fixes it, by checking for a package separator after the
potential keyword.
That d = s part of the KEY_CORE case in yylex was added in perl 5.001
(
748a9306) but apparently wasn’t doing anything. That means I get to
move it before s+=2, now that I have a use for it.
I added the tests a little above the ‘Add new tests HERE’ label in
parser.t, to avoid conflicting with other patches I’m working on.
Father Chrysostomos [Fri, 6 Jul 2012 21:19:21 +0000 (14:19 -0700)]
rv2cv hooks should not create 2nd-class subs
$ perl5.17.2 -Mblib -e 'sub foo{}; foo $bar; use Lexical::Sub baz => sub{}; baz $bar'
Can't call method "baz" on an undefined value at -e line 1.
$ perl5.17.2 -Mblib -e 'sub foo{}; foo bar; use Lexical::Sub baz => sub{}; baz bar'
Can't locate object method "baz" via package "bar" (perhaps you forgot to load "bar"?) at -e line 1.
So if you use Lexical::Sub, your sub doesn’t get to participate in
determining whether ‘foo $bar’ or ‘foo bar’ is a method call.
This is because Lexical::Sub uses an rv2cv hook to intercept sub
lookup. And toke.c:S_intuit_method thinks there cannot be a CV with-
out a GV (which was the case when it was first written).
Commit
f7461760 introduced this rv2cv hooking for bareword lookup, but
failed to update S_intuit_method accordingly.
Father Chrysostomos [Fri, 6 Jul 2012 12:35:01 +0000 (05:35 -0700)]
toke.c: Correct comment
Tony Cook [Sat, 7 Jul 2012 03:05:29 +0000 (13:05 +1000)]
perldelta: note a few interesting changes
Jesse Luehrs [Fri, 6 Jul 2012 03:11:34 +0000 (22:11 -0500)]
document the append parameter to sv_gets [perl #72244]
Craig A. Berry [Fri, 6 Jul 2012 02:30:06 +0000 (21:30 -0500)]
perldelta for
22831cc58b76.
Craig A. Berry [Thu, 5 Jul 2012 23:22:46 +0000 (18:22 -0500)]
Unquote spawned command verbs on VMS.
Prior to the current change,
$ foo "A" "b" "c"
worked, but the following didn't:
$ "foo" "A" "b" "c"
%DCL-E-PARSEFAIL, error parsing DCL$PATH:"foo".*
-RMS-F-FNM, error in file name
even if foo was a valid command or path. It's illegal in DCL to
quote the command verb even if it's often necessary to quote the
parameters to it.
But various things in the wild (such as Test::Harness::_filtered_inc),
find it convenient or necessary to quote the command verb, so the
easiest way to support that is to unquote it before DCL sees it, and
that's what this change does.
Also, spaces within the first quoted item are now escaped so that
an image path containing spaces doesn't run afoul of subsequent
tokenizing based on spaces.
Father Chrysostomos [Tue, 3 Jul 2012 01:11:23 +0000 (18:11 -0700)]
do-file should not force a bareword
A word following do is forced to be a bareword for do-sub’s sake. But
if it is going to be interpreted as do-file after all, that does not
make sense. ‘do subname;’ should call the sub and run the file whose
name it returns, instead of running the file named ‘subname’.
Father Chrysostomos [Mon, 2 Jul 2012 21:47:50 +0000 (14:47 -0700)]
Let do.t run from the top level
Father Chrysostomos [Mon, 2 Jul 2012 21:47:34 +0000 (14:47 -0700)]
do.t: Load test.pl at BEGIN time
so that parentheses can be omitted.
Father Chrysostomos [Sun, 1 Jul 2012 00:17:39 +0000 (17:17 -0700)]
Test ‘Missing name in "my sub"’
Jesse Luehrs [Fri, 6 Jul 2012 00:40:10 +0000 (19:40 -0500)]
both INT64_C and UINT64_C should be guarded [perl #76306]
Tony Cook [Wed, 17 Feb 2010 09:43:46 +0000 (20:43 +1100)]
rt #72232 - ignore wday/yday in mini_mktime as indirectly documented
David Golden [Fri, 6 Jul 2012 00:14:15 +0000 (20:14 -0400)]
perlfunc: clarify 'our' again for vars.pm behavior
rjbs discovered that vars.pm docs lie and it works within
a package, even across file scopes
David Golden [Fri, 6 Jul 2012 00:01:26 +0000 (20:01 -0400)]
perlfunc: clarify docs for 'package' [perl #113974]
This one word change clarifies that 'package' applies to
'lexically-scoped' variables rather than 'lexical' variables, which
people may misunderstand to mean only my/state declarations and thus be
confused by the nearby statements about it applying to 'our' as well.
No perldelta note was added as the change was trivial.
David Golden [Thu, 5 Jul 2012 23:58:28 +0000 (19:58 -0400)]
vars.pm: remove 'obsolete' description [perl #113974]
The phrase 'obsolete' in the abstract is not well defined
and may be inappropriate. This commit removes it and clarifies
that use of vars.pm is discouraged when 'our' could be used
instead.
No perldelta note was added, as the change is trivial, despite
the version number bump.
Ricardo Signes [Fri, 6 Jul 2012 00:05:04 +0000 (20:05 -0400)]
correct the perlfunc explanation of use vars
David Golden [Thu, 5 Jul 2012 23:39:59 +0000 (19:39 -0400)]
perlfunc: clarify docs for 'our' [perl #113974]
In response to the thread, this attempts to clarify the aliasing and
scope of 'our' (as well as 'use vars').
Nicholas Clark [Thu, 5 Jul 2012 21:16:29 +0000 (14:16 -0700)]
[perl #112820] t/op/sprintf.t failure on FreeBSD 4.6
t/op/sprintf.t fails one test on FreeBSD 4.6
*Everything* else passes. This is a pleasant surprise.
Patch adds a skip for FreeBSD 4, and should not skip on FreeBSD 5 and later.
Tested on FreeBSD 7 too. Due to the way versions don't map to real numbers,
4.6 > 4.11, whereas 4.6 <= 4.9 (and 4.9 <= 4.9, 4.10 <= 4.9 and 4.11 <= 4.9)
so the skip skips for all releases of FreeBSD 4.
Jesse Luehrs [Thu, 5 Jul 2012 13:54:55 +0000 (08:54 -0500)]
perldelta for 317f3b6
Father Chrysostomos [Thu, 5 Jul 2012 01:25:33 +0000 (18:25 -0700)]
Increase $B::Concise::VERSION to 0.91
Father Chrysostomos [Thu, 5 Jul 2012 01:22:09 +0000 (18:22 -0700)]
[perl #78064] print(const || bare) and const folding
Constant folding should not be able to change the meaning of print
followed by || or && or ?: with barewords as operands.
The previous commit recorded which constant ops are the result of con-
stant folding (including collapsing of conditionals).
This commit uses that information (OpCONST_FOLDED) to fix this.
Father Chrysostomos [Tue, 1 May 2012 01:18:03 +0000 (18:18 -0700)]
Record folded constants in the op tree
Father Chrysostomos [Wed, 4 Jul 2012 15:23:54 +0000 (08:23 -0700)]
Add Oleg Nesterov to AUTHORS
Oleg Nesterov [Wed, 4 Jul 2012 15:21:15 +0000 (08:21 -0700)]
[perl #113980] pp_syscall: "I32 retval" truncates the returned value
I noticed today that syscall(9, ...) (mmap) doesn't work for me.
The problem is obvious, pp_syscall() uses I32 for retval and the
"long" address doesn't fit into "int".
The one-liner below should fix the problem.
Father Chrysostomos [Wed, 4 Jul 2012 13:11:27 +0000 (06:11 -0700)]
Use ‘state’ in warning about sort {state $a}
Father Chrysostomos [Wed, 4 Jul 2012 05:21:45 +0000 (22:21 -0700)]
op.c: Merge some code
Tony Cook [Wed, 4 Jul 2012 05:21:27 +0000 (15:21 +1000)]
perldelta: move several change notes to Selected Bug Fixes
They were in Configuration and Compilation
Father Chrysostomos [Wed, 4 Jul 2012 04:34:59 +0000 (21:34 -0700)]
[perl #86136] Downgrade sort {my $a} to a warning
The code in toke.c for detecting lexical $a or $b used in a comparison
in a sort block was simply horrible. If the last-used named list or
unary op (PL_last_lop_op) was sort, then it would scan for <=> or cmp
anywhere on the current line of code. That meant that, although this
would die:
my $a; sort { $a <=> $b } ()
This would do the wrong thing without complaint:
my $a; sort { print; $a <=> $b } ()
And this would die, completely gratuitously:
my $a; sort @t; $a + $cmp;
Since perl is only guessing that lexical $a or $b *might* have
been used accidentally, this should be a warning, and certainly
not an error.
Also, scanning the source code like that for <=> (even inside a
string!) can never work. One would have to parse it and examine the
resulting op tree.
In fact, since we *are* parsing it anyway, we *can* examine
the op tree.
So that’s exactly what this commit does. Based on the existing behav-
iour, but with far fewer false positives, it checks for a cmp or <=>
op as the last statement of a sort block and warns about any operand
that is a lexical $a or $b.
Father Chrysostomos [Tue, 3 Jul 2012 21:50:30 +0000 (14:50 -0700)]
sv.c: Correct comment
S_varname is no longer static.
Jesse Luehrs [Wed, 4 Jul 2012 01:28:24 +0000 (20:28 -0500)]
fix perlobj SUPER example [perl #113972]
Father Chrysostomos [Tue, 3 Jul 2012 21:00:00 +0000 (14:00 -0700)]
parser.h: Add comments explaining *bufptr
Father Chrysostomos [Tue, 3 Jul 2012 20:56:42 +0000 (13:56 -0700)]
parser.h: Correct comment explaining last_lop_op
Father Chrysostomos [Tue, 3 Jul 2012 20:55:47 +0000 (13:55 -0700)]
sv.h: Improve docs of Sv[GS]ETMAGIC
Jesse Luehrs [Tue, 3 Jul 2012 18:06:50 +0000 (13:06 -0500)]
fix compile warnings in malloc.c [perl #75340]
Colin Kuskie [Fri, 22 Jun 2012 22:35:58 +0000 (15:35 -0700)]
Refactor t/op/splice.t to use t/test.pl instead of making TAP by hand.
Nicholas Clark [Tue, 3 Jul 2012 16:21:53 +0000 (18:21 +0200)]
Add another address for Colin Kuskie to checkAUTHORS.pl
Tony Cook [Tue, 3 Jul 2012 07:41:06 +0000 (17:41 +1000)]
[rt.cpan.org #61577] VMS doesn't support UNIX sockets
A casual reading of t/io_unix.t might lead you to believe it might,
but VMS also doesn't support fork, so the io_unix.t tests are skipped
anyway.
Eric Brine [Thu, 12 May 2011 05:21:50 +0000 (22:21 -0700)]
Avoid needless use of deprecated exists on array elements
Jesse Luehrs [Tue, 3 Jul 2012 05:50:34 +0000 (00:50 -0500)]
constant folding shouldn't change return value of while [perl #73618]
If the expression in while (EXPR) is a false constant, just return that
constant expression rather than OP_NULL during optimization.
Doesn't handle until loops yet, because "until (1)" is converted to
"while (!1)" by the parser, and so "!1" is already constant-folded to ''
by the time the while loop optree is constructed. Not sure what to do
about that.
Father Chrysostomos [Tue, 3 Jul 2012 05:27:47 +0000 (22:27 -0700)]
toke.c: Merge UNI2 and UNIBRACK
The only difference between them is the PL_expect assignment,
which can be controlled by a constant parameter that the C
compiler will optimise away.
Matthew Horsfall (alh) [Tue, 3 Jul 2012 05:20:39 +0000 (22:20 -0700)]
For #16249 - Overwrite PL_last_lop_op when eval() is called.
Otherwise, parsing later on down the road may use the previous value, which, if it was OP_PRINT, causes the parser to fail
Father Chrysostomos [Mon, 2 Jul 2012 19:34:10 +0000 (12:34 -0700)]
perlfunc: Fix do-sub mistake
do &foo() is the do-file operator on the return value of the sub,
not just a sub call.
Father Chrysostomos [Mon, 2 Jul 2012 16:49:17 +0000 (09:49 -0700)]
op.c:newFOROP: Fall back to realloc for unslabbed ops
When an op is allocated, PL_compcv is checked to see whether it can
hold an op slab if it does not hold one already. If PL_compcv is not
usable, for whatever reason, it falls back to malloc.
Since the new slab allocator was added in commit 8be227a, newFOROP has
been assuming, probably correctly, that its listop which it needs to
enlarge to a loopop was allocated by slab.
Since newFOROP is an API function, we should err on the safe side and
check first whether the op is slab-allocated, falling back to realloc
if it is not.
To trigger this potential bug, one has to set things up such that
there is a usable pad available, but no usable PL_compcv. I said
‘probably correctly’ above because this situation is highly unlikely
and probably indicative of bugs elsewhere. (But we should still err
on the side of safety.)
Craig A. Berry [Mon, 2 Jul 2012 00:48:03 +0000 (19:48 -0500)]
Fix ill-named Test::Harness test and bump version.
env.opts.t by its very existence causes the test suite to die on
VMS with:
$ perl TEST ../cpan/Test-Harness/t/compat/env.opts.t
Can't read ../cpan/test-harness/t/compat/env.opts.t.
%RMS-F-SYN, file specification syntax error
Enabling the extended filename character set will fix this but that's
not (yet) the default setting. So here we simply rename the file to
something legal.
Reported upstream as [rt.cpan.org #78127].
Jesse Luehrs [Mon, 2 Jul 2012 16:58:47 +0000 (11:58 -0500)]
fix 64-bit compiler warning
Father Chrysostomos [Mon, 2 Jul 2012 15:41:25 +0000 (08:41 -0700)]
pad.c: Improve intro_my docs
Father Chrysostomos [Sun, 1 Jul 2012 00:37:25 +0000 (17:37 -0700)]
Put a cap on op slab sizes
If a subroutine is *really* big, we don’t want to allocate, say, 4MB
for ops when just over 2 will do, just because there was one op more
than could fit in 2MB.
Father Chrysostomos [Sat, 30 Jun 2012 21:34:42 +0000 (14:34 -0700)]
Use find_runcv_where for pp_coreargs and pp_runcv
Nicholas Clark [Mon, 2 Jul 2012 12:44:13 +0000 (14:44 +0200)]
s/thinngy/thingy/ in a comment in sv.c
Tony Cook [Mon, 2 Jul 2012 10:19:52 +0000 (20:19 +1000)]
perldelta for
18042359,
9adbac0b
Tony Cook [Mon, 2 Jul 2012 10:14:58 +0000 (20:14 +1000)]
bump IO.pm version
cmpVERSION doesn't pick this up - should it?
Tony Cook [Mon, 2 Jul 2012 09:41:19 +0000 (19:41 +1000)]
[rt.cpan.org #61577] try harder to get socket information
also [perl #112736][debian #659075]
One of the tests may fail on HP-UX (but doesn't on the machine I have
access to) I plan to monitor smokes and add skips as needed.
Dominic Hargreaves [Wed, 9 May 2012 18:09:18 +0000 (19:09 +0100)]
add Test::More as a prereq to Makefile.PL
Tony Cook [Fri, 22 Jun 2012 10:57:09 +0000 (20:57 +1000)]
bump IO::Socket version
Tony Cook [Fri, 22 Jun 2012 10:25:06 +0000 (20:25 +1000)]
document the limitations of protocol(), sockdomain(), socktype()
Determining these for a new_from_fd() socket has the following problems:
protocol() depends on SO_PROTOCOL, and socktype() on SO_TYPE, not
implemented on all systems.
sockdomain() depends on sockname(), which is documented as
unimplemented for AF_UNIX sockets on HP-UX.
I'm not sure that detail is useful in the documentation.
Tony Cook [Wed, 13 Jun 2012 11:21:49 +0000 (21:21 +1000)]
[rt.cpan.org #61577] try to populate socket info when not cached
The fixes are originally by Daniel Kahn Gillmor
<dkg@fifthhorseman.net>, but I've made other changes.
Tony Cook [Wed, 13 Jun 2012 09:32:33 +0000 (19:32 +1000)]
[rt.cpan.org #61577] propagate socket details on accept
Tony Cook [Wed, 13 Jun 2012 09:27:22 +0000 (19:27 +1000)]
[rt.cpan.org #61577] sockdomain and socktype undef on newly accepted sockets
There appears to be a flaw in IO::Socket where some IO::Socket objects
are unable to properly report their socktype, sockdomain, or protocol
(they return undef, even when the underlying socket is sufficiently
initialized to have these properties).
The attached patch should cover IO::Socket objects created via accept(),
new_from_fd(), new(), and anywhere else whose details haven't been
properly cached.
No new code should be executed on IO::Socket objects whose details are
already cached and present.
These tests were original written by Daniel Kahn Gillmor
<dkg@fifthhorseman.net>, I've mangled them for use in a hopefully
final fix for the issue.
Karl Williamson [Sun, 1 Jul 2012 04:04:23 +0000 (22:04 -0600)]
Fix up pod references to deprecated function
Father Chrysostomos [Sat, 30 Jun 2012 19:43:26 +0000 (12:43 -0700)]
Cloning a format whose outside has been undefined
This has crashed ever since
71f882da8, because the format tries to
close over a pad that does not exist:
sub x {
{my ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k,$l,$m,$n,$o,$p,$q,$r,$s,$t,$u)}
my $z;
format =
@<<<
$z
.
}
undef &x;
write;
This commit adds checks for nonexistent pads, producing the ‘Variable
is not available’ warning in cases like this.
Shlomi Fish [Sat, 30 Jun 2012 13:40:43 +0000 (16:40 +0300)]
Fix perl -d’s "l" command.
The "l" command (without any arguments) got broken in blead, due to the
"use strict" patch because "$max = ..." was changed into "my $max = ..."
while $max should always be a global.
Darin McBride [Sat, 30 Jun 2012 05:46:43 +0000 (22:46 -0700)]
perldelta for 9d7bf4
Father Chrysostomos [Sat, 30 Jun 2012 05:25:28 +0000 (22:25 -0700)]
op.c: S_op_integerize: -foo no longer needs an exception
Father Chrysostomos [Sat, 30 Jun 2012 05:16:22 +0000 (22:16 -0700)]
pad.c: Update comments
Father Chrysostomos [Sat, 30 Jun 2012 00:34:38 +0000 (17:34 -0700)]
[perl #113012] String negation under ‘use integer’
This makes the negation operator under the integer pragma (i_int) use
the same logic for determining whether to do string negation as the
regular negation operator.
Before, this did not happen at all under the integer pragma, except
for barewords, resulting in strange inconsistencies:
$ perl -le 'use integer; print -foo'
-foo
$ perl -le 'use integer; print -"foo"'
0
The code for string negation is now in a static routine in pp.c and is
used by both types of negation.
Father Chrysostomos [Fri, 29 Jun 2012 21:49:53 +0000 (14:49 -0700)]
[perl #113006] perllocale: change Spanish to traditional Spanish
Nowadays, Spanish collation does not treat ch as a separate letter.
Father Chrysostomos [Fri, 29 Jun 2012 20:18:06 +0000 (13:18 -0700)]
op.c: Remove unnecessary variable
This is left over from when I had the partially-filled slab at the end
of the chain, instead of second (which was never committed).
Father Chrysostomos [Fri, 29 Jun 2012 19:41:21 +0000 (12:41 -0700)]
Don’t crash with formats in special blocks
Commit
421f30ed1e9 didn’t go far enough. If a special block happens
to replace a stub, then a format trying to close over variables in the
special block will be pointing to the wrong outer sub.
Such stubs shouldn’t usually happen, but perl shouldn’t crash.
Karl Williamson [Sat, 23 Jun 2012 19:30:36 +0000 (13:30 -0600)]
perlguts: Document that PV can point to non-string
Karl Williamson [Wed, 27 Jun 2012 22:24:43 +0000 (16:24 -0600)]
regcomp.c: Optimize /[0-9]/ into /\d/a
The commonly used [0-9] can be optimized into a smaller, faster node
that means the same thing.
Karl Williamson [Wed, 27 Jun 2012 20:43:41 +0000 (14:43 -0600)]
regcomp.c: Optimize e.g., /[^\w]/, /[[^:word:]]/ into /\W/
This optimizes character classes that have a single element that is one
of the ops that have the same meaning outside (namely \d, \h, \s, \w,
\v, :word:, :digit: and their complements) to that op. Those
ops take less space than a character class and run faster. An initial
'^' for complementing the class is also handled.
Karl Williamson [Wed, 27 Jun 2012 19:48:16 +0000 (13:48 -0600)]
regcomp.c: Simply some node calculations
For the node types that have differing versions depending on the
character set regex modifiers, /d, /l, /u, /a, and /aa, we can use the
enum values as offsets from the base node number to derive the correct
one. This eliminates a number of tests.
Because there is no DIGITU node type, I added placeholders for it (and
NDIGITU) to avoid some special casing of it (more important in future
commits). We currently have many available node types, so can afford to
waste these two.
Karl Williamson [Wed, 27 Jun 2012 19:28:13 +0000 (13:28 -0600)]
regcomp.sym: Reorder a couple of nodes
This causes all the nodes that depend on the regex modifier, BOUND,
BOUNDL, etc. to have the same relative ordering. This will enable a
future commit to simplify generation of the correct node.
Karl Williamson [Wed, 27 Jun 2012 00:14:23 +0000 (18:14 -0600)]
reg_fold.t: Make test cases non-optimizable away
This commit changes the bracketed character classes to include a
non-related character. This is in preparation for a future commit which
would cause the current character classes to be optimized into EXACTish
nodes which would start passing TODO tests, but don't fix the underlying
problem with character classes. That bug is that you can't split a
multi-char fold across nodes. It probably is not fixable in Perl without
a total restructuring of the regular expression mechanism. For example,
"\N{LATIN SMALL LIGATURE FFI}" doesn't match /[f][f][i]/i. But it would
if those got optimized into a single EXACTF node. (The problem is not
limited to character classes, /(f)(f)(i)/i also doesn't match, and
can't, as $1, $2, and $3 are not well-defined.)
Karl Williamson [Sun, 24 Jun 2012 20:16:44 +0000 (14:16 -0600)]
regcomp.c: Simplify compile time [^..] complement
This simply moves the code that populates the bitmap and combines the
two inversion lists to after the inversion (the differences are shown
much greater than there really are, since a move is done.) This greatly
simplifies complementing the character class.
Karl Williamson [Sun, 24 Jun 2012 20:02:48 +0000 (14:02 -0600)]
regcomp.c: Rename variable to reflect new purpose
This variable really holds the list of all code points the bracketed
character class matches; it's not just the ones not in the bitmap.
Karl Williamson [Sun, 24 Jun 2012 03:25:36 +0000 (21:25 -0600)]
regcomp.c: Have a subroutine do the work
Since this code was originally written, the fold function has added
input flags that cause it to do the same thing this code does. So do it
in the subroutine.
Karl Williamson [Sat, 23 Jun 2012 21:48:42 +0000 (15:48 -0600)]
regcomp.c: Remove obsolete code
A previous commit has removed all calls to these two functions (moving a
large portion of the bit_fold() one to another place, and no longer sets
the variable.
Karl Williamson [Sat, 23 Jun 2012 20:19:02 +0000 (14:19 -0600)]
regcomp.c: White-space, comments only
This indents, outdents previous code, based on new/removed outer blocks.
It reflows comments and code to fit into 80 columns, add/removes blank
lines, minor comment rewording
Karl Williamson [Sat, 23 Jun 2012 21:24:38 +0000 (15:24 -0600)]
regcomp.c: Remove unnecessary 'if' test
A previous commit has refactored things, so this test is always true
Karl Williamson [Sat, 23 Jun 2012 21:00:26 +0000 (15:00 -0600)]
regcomp.c: Use more inversion lists in [] char classes
This changes the building of bracketed character classes to use
inversion lists instead of a bitmap/inversion list combination.
This will lead in later commits to simplification and extending
optimizations to beyond the Latin1 range.
Karl Williamson [Sat, 23 Jun 2012 18:57:54 +0000 (12:57 -0600)]
handy.h: Fix isBLANK_uni and isBLANK_utf8
These macros have never worked outside the Latin1 range, so this extends
them to work.
There are no tests I could find for things in handy.h, except that many
of them are called all over the place during the normal course of
events. This commit adds a new file for such testing, containing for
now only with a few tests for the isBLANK's
Karl Williamson [Sat, 23 Jun 2012 18:03:42 +0000 (12:03 -0600)]
no_utf8_pm.t: Add blank between 'not' and 'ok' in .t
Jesse Luehrs [Fri, 29 Jun 2012 16:23:59 +0000 (11:23 -0500)]
fix compiler warning
Father Chrysostomos [Fri, 29 Jun 2012 07:50:30 +0000 (00:50 -0700)]
Make formats close over the right closure
This was brought up in ticket #113812.
Formats that are nested inside closures only work if invoked from
directly inside that closure. Calling the format from an inner sub
call won’t work.
Commit
af41786fe57 stopped it from crashing, making it work as well
as 5.8, in that closed-over variables would be undefined, being
unavailable.
This commit adds a variation of the find_runcv function that can check
whether CvROOT matches an argument passed in. So we look not for the
current sub, but for the topmost sub on the call stack that is a clone
of the closure prototype that the format’s CvOUTSIDE field points to.
Father Chrysostomos [Fri, 29 Jun 2012 06:12:23 +0000 (23:12 -0700)]
[perl #113812] Always use find_runcv when cloning a sub
A closure prototype’s CvOUTSIDE pointer might have been modified if
its containing sub is freed first. When a sub is cloned, the enclos-
ing sub is always the currently-running sub (not so for formats).
So this commit makes subs always use find_runcv, the way they did
before
71f882da828.
So the closure logic which was needed for formats is now moved into an
else branch that is used only for them.
Father Chrysostomos [Fri, 29 Jun 2012 07:22:25 +0000 (00:22 -0700)]
[Merge] CV-based slab allocator for ops
This branch uses per-CV slabs for ops, so that ops can all be freed
after compilation errors, fixing memory leaks and a crash.
See commit
8be227ab5e for how it works.
Father Chrysostomos [Thu, 28 Jun 2012 16:13:40 +0000 (09:13 -0700)]
Teach diagnostics.pm about %p
Father Chrysostomos [Thu, 28 Jun 2012 16:10:56 +0000 (09:10 -0700)]
Increase $diagnostics::VERSION to 1.30
Father Chrysostomos [Thu, 28 Jun 2012 15:52:10 +0000 (08:52 -0700)]
perldiag: Document ‘Slab leaked from cv’
Father Chrysostomos [Thu, 28 Jun 2012 05:40:48 +0000 (22:40 -0700)]
When reusing op slots, only zero as much as needed
If an op slot is reused for a smaller op, we only need to zero out the
space used for the op, not the whole slot.
Father Chrysostomos [Thu, 28 Jun 2012 05:38:25 +0000 (22:38 -0700)]
-DS should not invoke warnhook
I was using Perl_warn, both for its convenience, and because the line
numbers were extremely helpful in tracking bugs.
But it invokes the warnhook, if present, and also respects tied
STDERR. We should be using Perl_debug_log.
Changing this also avoids the need for /* diag_listed_as: SKIPME */
all over the place.
Father Chrysostomos [Wed, 27 Jun 2012 03:27:37 +0000 (20:27 -0700)]
op.c: Memory funcs need dVAR
Father Chrysostomos [Tue, 26 Jun 2012 21:30:40 +0000 (14:30 -0700)]
fresh_perl.t: Skip #112312 tests on miniperl
They require attributes.pm.
Father Chrysostomos [Tue, 26 Jun 2012 20:24:13 +0000 (13:24 -0700)]
Enlarge the last slot on an op slab to fit
For simplicity, op slots are never resized once they are allocated.
But they are reused after they are freed, if they are big enough.
When allocating the last op slot that will fit on a slab, we might as
well enlarge the slot to contain whatever space is left over, so this
slot, after being freed, can be reused for a larger op.
Father Chrysostomos [Tue, 26 Jun 2012 17:08:58 +0000 (10:08 -0700)]
Define cv_forget_slab under PL_OP_SLAB_ALLOC
Instead of using #ifndef every time we call cv_forget_slab, just
define it as a no-op under PL_OP_SLAB_ALLOC.
Father Chrysostomos [Sun, 24 Jun 2012 06:34:13 +0000 (23:34 -0700)]
Test perl #112312, crash on syntax error
I am having difficulty getting these tests to fail. They crash when
run standalone, but always pass when run via fresh_perl.t. Hopefully,
they will fail somewhere. :-)
Yes, fresh_perl.t does begin with this:
# ** DO NOT ADD ANY MORE TESTS HERE **
But t/comp/parser.t does not (and should not) use test.pl, so it is
very hard to test something like this.
Putting it here seemed slightly better than putting it in
its own file.