This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
9 years agoTurn on memory leak reporting for CFG = DebugFull builds on Windows
Steve Hay [Sun, 15 Feb 2015 16:06:43 +0000 (16:06 +0000)]
Turn on memory leak reporting for CFG = DebugFull builds on Windows

Setting _CRTDBG_LEAK_CHECK_DF arranges for _CrtDumpMemoryLeaks() to be
called automatically at program termination, outputting a report of all
allocations that have not been freed into the Output window in Developer
Studio.

If a leak is reported then note its allocation number, change the -1 in
the _CrtSetBreakAlloc(-1L) call to the leaked allocation number and
rebuild. A breakpoint will be set on the allocation call that leaked.

(A slicker approach is to have the report include the file name and line
number of the leaked allocation call by inserting

#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>

early in each compilation unit (e.g. by inserting it early in perl.h), but
that works by re-#defining malloc/free etc, which unfortunately clashes
with #defines in win32/win32iop.h and with the 'free' member of the
regexp_engine struct in regexp.h.)

9 years agoAdd comments about how backrefs are parsed
Yves Orton [Sun, 15 Feb 2015 07:45:18 +0000 (15:45 +0800)]
Add comments about how backrefs are parsed

9 years agofix infinite loop in parsing backrefs in regex patterns
Yves Orton [Sun, 15 Feb 2015 07:38:29 +0000 (15:38 +0800)]
fix infinite loop in parsing backrefs in regex patterns

9 years agoAdd a TODO test for not infinite looping during regex backref parsing
Yves Orton [Sun, 15 Feb 2015 07:26:22 +0000 (15:26 +0800)]
Add a TODO test for not infinite looping during regex backref parsing

9 years agoadd a comment so people looking for "sub run_perl" find the right thing
Yves Orton [Sun, 15 Feb 2015 06:53:39 +0000 (14:53 +0800)]
add a comment so people looking for "sub run_perl" find the right thing

9 years agoCopy perl5202delta into blead
Steve Hay [Sat, 14 Feb 2015 19:10:37 +0000 (19:10 +0000)]
Copy perl5202delta into blead

9 years agoUpdate release schedule: 5.20.2 is done; 5.20.3 will probably happen
Steve Hay [Sat, 14 Feb 2015 18:49:34 +0000 (18:49 +0000)]
Update release schedule: 5.20.2 is done; 5.20.3 will probably happen

9 years agoUpdate Porting/epigraphs.pod for Perl 5.20.2
Steve Hay [Sat, 14 Feb 2015 18:43:51 +0000 (18:43 +0000)]
Update Porting/epigraphs.pod for Perl 5.20.2

9 years agoMore updates to Module-CoreList for Perl 5.20.2
Steve Hay [Sat, 14 Feb 2015 16:24:32 +0000 (16:24 +0000)]
More updates to Module-CoreList for Perl 5.20.2

The date-based $VERSIONs for the 5.20.2 release need updating too. The
module files' $VERSIONs are left on 5.20150220 in blead for the impending
release of 5.21.9, though; they will only be updated to 5.20150214 in the
maint-5.20 branch itself.

9 years agoUpdate perlhist: Perl 5.20.2 today
Steve Hay [Sat, 14 Feb 2015 15:59:46 +0000 (15:59 +0000)]
Update perlhist: Perl 5.20.2 today

9 years agoUpdate Module-CoreList: Perl 5.20.2 today
Steve Hay [Sat, 14 Feb 2015 15:59:31 +0000 (15:59 +0000)]
Update Module-CoreList: Perl 5.20.2 today

9 years agoTwo more typographic cleanups, suggested by alh++.
James E Keenan [Sat, 14 Feb 2015 14:48:51 +0000 (09:48 -0500)]
Two more typographic cleanups, suggested by alh++.

9 years agoSet NAN_COMPARE_BROKEN on VMS with long doubles.
Craig A. Berry [Sat, 14 Feb 2015 14:26:02 +0000 (08:26 -0600)]
Set NAN_COMPARE_BROKEN on VMS with long doubles.

This gets us passing more (but not all) of the infnan.t tests
with long doubles (which are true 128-bit IEEE 754 gizmos).

9 years agoCorrect typo in code example.
James E Keenan [Sat, 14 Feb 2015 14:20:42 +0000 (09:20 -0500)]
Correct typo in code example.

Reported by saint.snit++

For: RT #123820

9 years agoUnicode::UCD: Generalize for EBCDIC platforms
Karl Williamson [Sat, 14 Feb 2015 04:51:56 +0000 (21:51 -0700)]
Unicode::UCD: Generalize for EBCDIC platforms

9 years agoUnicode::UCD::prop_aliases(): return correct long and short names
Karl Williamson [Fri, 13 Feb 2015 22:28:34 +0000 (15:28 -0700)]
Unicode::UCD::prop_aliases(): return correct long and short names

Certain of the Perl extensions did not have the correct long and short
names returned.

9 years agomktables: Rip out redundant tables
Karl Williamson [Fri, 13 Feb 2015 22:14:46 +0000 (15:14 -0700)]
mktables: Rip out redundant tables

Experimentally, we changed the definition of Perl's space to include a
vertical tab, thus being identical to the Posix space definition.  In
case we had to back this out, I left these as separate tables, but now
that experiment is considered a success, and those tables can be
collapsed.  Later commits will finish up removing the experimental
status of this.

9 years agomktables: Fix looping recursive detection
Karl Williamson [Fri, 13 Feb 2015 22:06:15 +0000 (15:06 -0700)]
mktables: Fix looping recursive detection

This code was spuriously finding that the was a loop in what is being
output.  Use 'local' to fix it.

9 years agomktables: Remove unused variable
Karl Williamson [Fri, 13 Feb 2015 18:08:30 +0000 (11:08 -0700)]
mktables: Remove unused variable

9 years agomktables: Fix typo in comment
Karl Williamson [Fri, 13 Feb 2015 18:07:21 +0000 (11:07 -0700)]
mktables: Fix typo in comment

9 years agobench.pl: fix doc --sort thinko
David Mitchell [Fri, 13 Feb 2015 12:47:36 +0000 (12:47 +0000)]
bench.pl: fix doc --sort thinko

--sort's arg is field:perl, not perl:field

9 years agoadd some more tests for RT #123743
David Mitchell [Fri, 13 Feb 2015 11:54:53 +0000 (11:54 +0000)]
add some more tests for RT #123743

In addition to /.*/, also check that /.*?/ isn't slow.

9 years agoadd a comment documenting STATIC_ASSERT_GLOBAL/STATIC_ASSERT_STMT
Lukas Mai [Fri, 13 Feb 2015 10:07:38 +0000 (11:07 +0100)]
add a comment documenting STATIC_ASSERT_GLOBAL/STATIC_ASSERT_STMT

9 years agoAdd new DebugSymbols and DebugFull CFG options to Windows makefiles
Steve Hay [Thu, 12 Feb 2015 14:18:06 +0000 (14:18 +0000)]
Add new DebugSymbols and DebugFull CFG options to Windows makefiles

This commit implements the suggestion from perl #123439 of adding a
CFG=DebugSymbols option for a debug mode build without enabling perl's
-DDEBUGGING code, and also adds a CFG=DebugFull option for a debug mode
build which uses the debug version of the CRT and enables -D_DEBUG code
(in perl and in the CRT) such as extra assertions and invalid parameter
warnings. (Note that failed invalid parameter checks are harmless thanks
to perl's invalid parameter handler in win32/win32.c. However, blindly
ignoring them is not a good thing. Compiling with _DEBUG causes the handler
to print warnings on STDERR about checks that have failed. Ideally these
should be fixed, or silenced by some other means if they really are
harmless--as was done for some such warnings by commit d52ca5864f.)

I attempted to do something like the DebugFull part once before, but was
held back by miniperl not using PerlIO, which resulted in a huge number of
invalid parameter warnings:

http://www.nntp.perl.org/group/perl.perl5.porters/2012/09/msg191674.html

However, that issue was recently removed by commit 8c847e6678, which
removed Windows makefile support for building without PerlIO, including
making miniperl now use PerlIO.

As noted in the makefiles comments, however, there are still a few cases
of invalid parameter warnings, which is partly why I've added the new
DebugFull option, rather than altering the existing Debug option.

9 years agobisect-runner.pl: Fix too long verbatim in pod
Karl Williamson [Thu, 12 Feb 2015 17:19:10 +0000 (10:19 -0700)]
bisect-runner.pl: Fix too long verbatim in pod

Verbatim lines only have to be indented one space to be effective and to
show as offset from the surrounding text.  By decreasing the
indentation, this commit causes the lines not to wrap.

9 years agoUpdate Pod-Perldoc to CPAN version 3.25
Chris 'BinGOs' Williams [Thu, 12 Feb 2015 12:51:06 +0000 (12:51 +0000)]
Update Pod-Perldoc to CPAN version 3.25

  [DELTA]

3.25 - Thu Feb 12 03:06:43 UTC 2015
    * No changes - roll an official
      release for inclusion in Perl 5.22

3.24_02 - Wed Jan 21 03:12:37 UTC 2015
    * Dave Mitchell sent a patch to reduce stderr spam
      during core perl builds. Resolves RT#101493

    * Make perldoc honor the MANPAGER environment
      variable as documented. Resolves RT#100933

    * Decode command line arguments at UTF-8 data.
      Resolves RT#9806

3.24_01 - Wed Sep 10 03:13:58 UTC 2014
    * The 'ToTerm' backend generates terminal escape sequences that
      the 'less' pager does not display by default. The "-R" option
      controls this, so pass it in the LESS environment variable
      to avoid disturbing other pager invocations. Patch by
      Niko Tyni. Closes RT#98636

    * Unify filehandle opens and encoding into two methods
      'open_fh' and 'set_encoding'.  Based on a pull request
      by Koichi KUBO. Closes RT#98019 better than c3fd47f :)

    * Applied PR by Olivier Mengué to 'use parent' instead
      of 'use base'

9 years agofix assertions for UTF8_TWO_BYTE_HI/LO
Hugo van der Sanden [Thu, 12 Feb 2015 00:11:31 +0000 (00:11 +0000)]
fix assertions for UTF8_TWO_BYTE_HI/LO

Replace the stricter MAX_PORTABLE_UTF8_TWO_BYTE check with a looser
MAX_UTF8_TWO_BYTE check, else we can't correctly convert codepoints in
the range 0x400-0x7ff from utf16 to utf8 on non-ebcdic platforms.

9 years agoAdd --crash option for Porting/bisect
Hugo van der Sanden [Wed, 11 Feb 2015 17:24:33 +0000 (17:24 +0000)]
Add --crash option for Porting/bisect

If --crash is specified, treat test cases as bad only if they exit with
($? & 0xff) non-zero.

9 years agoUpdate Pod-Parser to CPAN version 1.63
Chris 'BinGOs' Williams [Wed, 11 Feb 2015 14:30:08 +0000 (14:30 +0000)]
Update Pod-Parser to CPAN version 1.63

  [DELTA]

 10-Feb-2015           Marek Rouchal                        <marekr@cpan.org>
 -----------------------------------------------------------------------------
 Version 1.63
 + CPAN#101847: [PATCH] Bump $VERSION in module changed since Pod-Parser-1.60
   increased VERSION in all *.pm files
 + CPAN#98610: Pod::Find should skip also object directories of modern vc
   systems (.git, .hg)
   implemented in Pod::Find
 Thanks for the reports and patches!

9 years agoUpdate Config-Perl-V to CPAN version 0.23
Chris 'BinGOs' Williams [Wed, 11 Feb 2015 14:26:13 +0000 (14:26 +0000)]
Update Config-Perl-V to CPAN version 0.23

  [DELTA]

0.23  - 11 Feb 2015, H.Merijn Brand
    * Update copyright to 2015
    * Add summary tests
    * Remove perl recommendation from META as it breaks cpan clients
    * Move repo to github

9 years agoinfnan: revert nan payload/signaling changes
Jarkko Hietaniemi [Wed, 11 Feb 2015 13:49:27 +0000 (08:49 -0500)]
infnan: revert nan payload/signaling changes

4258cf903c752ec19a3aeee9b93020533d923e1a
91e945c051cfcdf499d5b43aa5ac0a5681cdd595
eb254f2672a985ec3c34810f624f36c18fc35fc7
c9a671b17a9c588469bcef958038daaaaf9cc88b
99fcdd4df47515fb0a62a046e622adec0871754d
ba511db061a88439acb528a66c780ab574bb4fb0
0d1cf11425608e9be019f27a3a4575bc71c49e6b
c2ea8a88f8537d00ba25ec8feb63ef5dc085ef2b
b5a6eedc2f49a90089cca896ee20f41e373fb4c9
30419b527d2c5a06cefe2db9183f59e2697c47fc
29b62199cd4c359dfc6b9d690341de40d105ca5f
be181dc9d91c84a2fe03912c993c8259fed92641
4de1bcfe1abdaba0a5da394ddea0cc6fd7e36c7b
6e915616c4ccb4f6cc3122c5d395765db96c0a2d
b2e3501558a1017eb529be0915c25d31671e7869
bfaa02d55f4ace1571e6fa9e5b47d5e3ac3cecc6
569f27e562618bdddcf4a9fc71612283a73747e9
4f89311dc8de87ddc9a302c6f2d2c844951bbd28
a307a0b0d83c509cc2adaad8cebb44260294bf36
6640aa2c3b93d7ac78e4e86983fe5948b3ca55f2
b74dc0b3c96390d8bf83d8c3ffc0c2c2d1f0a5d3
c3a8e5a5b4bb89a15de642c023dfd5cbc4678938

9 years agoinfnan: store the nan payload error in an optional SV
Jarkko Hietaniemi [Wed, 11 Feb 2015 13:24:55 +0000 (08:24 -0500)]
infnan: store the nan payload error in an optional SV

9 years agoinfnan: perldata tweaks
Jarkko Hietaniemi [Wed, 11 Feb 2015 12:55:55 +0000 (07:55 -0500)]
infnan: perldata tweaks

9 years agoRemove duplicate declaration of win32_stat from win32/win32iop.h
Steve Hay [Tue, 10 Feb 2015 08:51:26 +0000 (08:51 +0000)]
Remove duplicate declaration of win32_stat from win32/win32iop.h

The same declaration appears slightly higher up in the same file.

9 years agoSilence compiler warnings with gcc 4.7.2 and 4.8.1 from www.mingw.org
Steve Hay [Tue, 10 Feb 2015 08:23:22 +0000 (08:23 +0000)]
Silence compiler warnings with gcc 4.7.2 and 4.8.1 from mingw.org

These compilers (with other contemporaneous packages, I forget exactly
which versions of everything I have installed) contain

#define fstat _fstat

in include/sys/stat.h, which clashes with win32/win32iop.h's #define and
causes "warning: "fstat" redefined [enabled by default]" for just about
every .c file compiled. Likewise for stat.

9 years agoUnicode::UCD: Fix synopsis
Karl Williamson [Thu, 22 Jan 2015 22:06:43 +0000 (15:06 -0700)]
Unicode::UCD: Fix synopsis

Instead of using a constant code point in some of the lines, use the
$variable that is used in other lines

Spotted by Dagfinn Ilmari Mannsåker

9 years agoinfnan: separate the nan payload overflow and invalid messages
Jarkko Hietaniemi [Wed, 11 Feb 2015 00:37:54 +0000 (19:37 -0500)]
infnan: separate the nan payload overflow and invalid messages

Also: display the payload, and the number of bits

9 years agoinfnan: change the invalid nan message, add to perldiag
Jarkko Hietaniemi [Tue, 10 Feb 2015 18:26:50 +0000 (13:26 -0500)]
infnan: change the invalid nan message, add to perldiag

9 years agoinfnan: "nan(1)cy" should numify to $NaN, but also warn
Jarkko Hietaniemi [Tue, 10 Feb 2015 18:18:20 +0000 (13:18 -0500)]
infnan: "nan(1)cy" should numify to $NaN, but also warn

More test cases.

9 years agoUnicode::UCD: Add prop_values() function
Karl Williamson [Tue, 27 Jan 2015 22:08:08 +0000 (15:08 -0700)]
Unicode::UCD: Add prop_values() function

This new function returns the input property's possible values.

9 years agoUpdate Socket to CPAN version 2.017
Chris 'BinGOs' Williams [Tue, 10 Feb 2015 16:12:31 +0000 (16:12 +0000)]
Update Socket to CPAN version 2.017

  [DELTA]

2.017   2015/02/10 12:05:14
        [CHANGES]
         * Added some more SO_* constants defined on Linux (thanks
           Ronald van Dorp)

        [BUGFIXES]
         * Remember to SvGETMAGIC in getnameinfo() (RT79557)
         * Quiet some compiler warnings (RT101495, RT100736)
         * Fix "Attempt to free unreferenced scalar" warnings (RT78626, et.al.)

9 years agoremove invalid ASSUME from MULTIDEREF code
David Mitchell [Tue, 10 Feb 2015 15:03:54 +0000 (15:03 +0000)]
remove invalid ASSUME from MULTIDEREF code

RT #123735

The code that examines ops looking for OP_MULTIDEREF candidates,
makes assertions about what flags it think can be present on ops;
the idea being that if those assumptions change, the optimisation
code may need changing too.

However, the following syntax-errored code

    print
    my(r)

can trigger the assertion about PARENS not being set on an OP_GV.
So don't assert that.

9 years ago[perl #123782] regcomp: check for overflow on /(?123)/
Hugo van der Sanden [Tue, 10 Feb 2015 14:25:42 +0000 (14:25 +0000)]
[perl #123782] regcomp: check for overflow on /(?123)/

AFL (<http://lcamtuf.coredump.cx/afl>) found that the UV to I32 conversion
can evade the necessary range checks on wraparound, leading to bad reads.

Check for it, and force to I32_MAX, expecting that this will usually
yield a "Reference to nonexistent group" error.

9 years agosimpify and speed up /.*.../ handling
David Mitchell [Tue, 10 Feb 2015 12:17:51 +0000 (12:17 +0000)]
simpify and speed up /.*.../ handling

See RT ##123743.

A pattern that starts /.*/ has a fake MBOL or SBOL flag added, along
with PREGf_IMPLICIT.

The idea is that, with /.*.../s, if the NFA don't match when started at
pos 0, then it's not going to match if started at any other position
either; while /.*.../ won't match at any other start position up until
the next \n.

However, the branch in regexec() that implemented this was a bit a mess
(like much in the perl core, it had gradually accreted), and caused
intuit-enabled /.*.../ and /.*...patterns to go quadratic.

The branch looked roughly like:

    if (anchored) {
        if (regtry(s)) goto success;
        if (can_intuit) {
            while (s < end) {
                s = intuit(s+1);
                if (!s) goto fail;
                if (regtry(s)) goto success;
            }
        }
        else {
            while (s < end) {
                s = skip_to_next_newline(s);
                if (regtry(s)) goto success;
            }
        }
    }

The problem is that in the presence of a .* at the start of the pattern,
intuit() will always return either NULL on failure, or the start position,
rather than any later position. So the can_intuit branch above calls
regtry() on every character position.

This commit fixes this by changing the structure of the code to be like
this, where it only tries things on newline boundaries:

    if (anchored) {
        if (regtry(s)) goto success;
        while (1) {
            s = skip_to_next_newline(s);
            if (can_intuit) {
                s = intuit(s+1);
                if (!s) goto fail;
            }
            if (regtry(s)) goto success;
        }
    }

This makes the code a lot simpler, and mostly avoids quadratic behaviour
(you can still get it with a string consisting mainly of newlines).

9 years agoperldelta for f5fe1b19fc61
Tony Cook [Tue, 10 Feb 2015 06:02:59 +0000 (17:02 +1100)]
perldelta for f5fe1b19fc61

9 years agoremove the shell fallback from list pipe open on Win32
Tony Cook [Tue, 10 Feb 2015 04:54:16 +0000 (15:54 +1100)]
remove the shell fallback from list pipe open on Win32

This is a potential security issue, and while we'd need a deprecation
cycle to remove it from system(), there hasn't been a production
release of perl with list pipe open, so we can pretend it never was.

Without the shell, CreateProcess() won't pick up .cmd or .bat files,
which several perl utilities are packaged as on Win32, so use
qualified_path() to produce a full executable name.

9 years agoregcomp can read past end of string after parsing flags
Hugo van der Sanden [Tue, 10 Feb 2015 02:09:13 +0000 (02:09 +0000)]
regcomp can read past end of string after parsing flags

New test in 8a6d8ec6fe revealed additional code problem reading past
end of string under clang with sanitize=address.

9 years agoperldelta for 9efda33a86bb, 296f0d566b9f
Tony Cook [Tue, 10 Feb 2015 00:25:22 +0000 (11:25 +1100)]
perldelta for 9efda33a86bb296f0d566b9f

9 years ago[perl #123554] fix threaded builds and prevent a warning
Tony Cook [Tue, 10 Feb 2015 00:24:22 +0000 (11:24 +1100)]
[perl #123554] fix threaded builds and prevent a warning

9 years ago[perl #123554] catch a couple of other size overflows
Tony Cook [Mon, 9 Feb 2015 23:19:56 +0000 (10:19 +1100)]
[perl #123554] catch a couple of other size overflows

Unfortunately, running out of memory in safesysmalloc() and
safesysrealloc() doesn't produce a catchable croak(), so remove the
test.

9 years ago[perl #123755] including unknown char in error requires care
Hugo van der Sanden [Sat, 7 Feb 2015 16:31:04 +0000 (16:31 +0000)]
[perl #123755] including unknown char in error requires care

AFL (<http://lcamtuf.coredump.cx/afl>) found that when producing the
error message for /(??/ we hit an assert because we've stepped past
the end of the pattern string. Code inspection found that we also do
that in other branches, and we also need to check UTF more carefully.

9 years ago[perl #123759] always count on OPpTRANS_IDENTICAL
Hugo van der Sanden [Sun, 8 Feb 2015 13:53:00 +0000 (13:53 +0000)]
[perl #123759] always count on OPpTRANS_IDENTICAL

If we detect that an in-place transliteration will not result in any
changes to the string, we set OPpTRANS_IDENTICAL and skip the normal
checks for readonlyness; but if we do that, we must make sure to use
the same logic to decide which transliteration strategy to use, or
we may end up trying to write to the readonly string anyway.

This resulted in several ways to hit assert failures, found by AFL
(<http://lcamtuf.coredump.cx/afl>).

9 years ago[perl #123677] Crash with token stack overflow
Father Chrysostomos [Mon, 9 Feb 2015 05:29:59 +0000 (21:29 -0800)]
[perl #123677] Crash with token stack overflow

In this naughty code snippet:

s)$0{0h());qx(@0);qx(@0);qx(@0)

the s)...)) is treated as a substition, with $0{0h( for the left part.
When the lexer reaches the h( it tries to emit two tokens at once, '&'
and a WORD token representing the h.  To do that it pushes the WORD on
to the pending token stack and then emits '&'.  The next call to yylex
will usually pop the token off the pending stack and use that, because
the lexing state (PL_lex_state) is LEX_KNOWNEXT.

However, when the parser sees '&', it immediately reports it as
a syntax error, and tries to pop tokens to make sense of what it
has, popping scopes in the process.  Inside a quote-like operator,
PL_lex_state is localised, so the value after this scope-popping is
no longer LEX_KNOWNEXT, so the next call to yylex continues parsing
‘;qx...’ and ignores the pending token.

When it reaches the @0 inside the qx, it tries to push five pending
tokens on to the stack at once, because that’s how the implicit join
works.  But the stack only has room for five items.  Since it already
has one, the last item overflows, corrupting the parser state.
Crashes ensue.

If we check for the number of pending tokens and always emit any
regardless of the lexing state, then we avoid the crash.  This is
arguably how it should have been written to begin with.

This makes LEX_KNOWNEXT, and probably PL_lex_defer, redundant, but I
will wait till after perl 5.22 before removing those, as the removal
may break CPAN modules, and this is a little late in the dev cycle.

9 years agotoke.c: Assert that we don’t overflow token stack
Father Chrysostomos [Mon, 9 Feb 2015 04:24:15 +0000 (20:24 -0800)]
toke.c: Assert that we don’t overflow token stack

With this assertion, the test case from #123743 fails sooner.

9 years agoConsistent spaces after dots in perldata
Father Chrysostomos [Mon, 9 Feb 2015 04:04:50 +0000 (20:04 -0800)]
Consistent spaces after dots in perldata

9 years agoinfnan: document the infnan a bit
Jarkko Hietaniemi [Sat, 7 Feb 2015 23:13:43 +0000 (18:13 -0500)]
infnan: document the infnan a bit

9 years agoinfnan: test nan payload input/output
Jarkko Hietaniemi [Sat, 7 Feb 2015 20:09:05 +0000 (15:09 -0500)]
infnan: test nan payload input/output

9 years agoinfnan: add POSIX::issignaling
Jarkko Hietaniemi [Sat, 7 Feb 2015 22:27:24 +0000 (17:27 -0500)]
infnan: add POSIX::issignaling

The current best guess for the eventual name of the C interface.
(http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1664.pdf)

9 years agoinfnan: the nan quiet/signaling bit is not enough
Jarkko Hietaniemi [Sun, 8 Feb 2015 17:45:01 +0000 (12:45 -0500)]
infnan: the nan quiet/signaling bit is not enough

9 years agoinfnan: the x86 80-bit extended precision is special
Jarkko Hietaniemi [Sat, 7 Feb 2015 20:47:59 +0000 (15:47 -0500)]
infnan: the x86 80-bit extended precision is special

9 years agoinfnan: API context juggling
Jarkko Hietaniemi [Sun, 8 Feb 2015 00:39:55 +0000 (19:39 -0500)]
infnan: API context juggling

9 years agoinfnan: grok_number* setting the infnan NV directly
Jarkko Hietaniemi [Sat, 7 Feb 2015 20:07:08 +0000 (15:07 -0500)]
infnan: grok_number* setting the infnan NV directly

9 years agoinfnan: nan payload output with sprintf %#g
Jarkko Hietaniemi [Sat, 7 Feb 2015 19:42:47 +0000 (14:42 -0500)]
infnan: nan payload output with sprintf %#g

9 years agoinfnan: space for nan payload output
Jarkko Hietaniemi [Sat, 7 Feb 2015 19:48:22 +0000 (14:48 -0500)]
infnan: space for nan payload output

9 years agoinfnan: move S_hextract earlier
Jarkko Hietaniemi [Sat, 7 Feb 2015 19:31:25 +0000 (14:31 -0500)]
infnan: move S_hextract earlier

9 years agoinfnan: add grok_nan and grok_nan_payload
Jarkko Hietaniemi [Sat, 7 Feb 2015 19:28:30 +0000 (14:28 -0500)]
infnan: add grok_nan and grok_nan_payload

9 years agoinfnan: add nan_payload_set
Jarkko Hietaniemi [Sat, 7 Feb 2015 19:16:04 +0000 (14:16 -0500)]
infnan: add nan_payload_set

9 years agoinfnan: add nan_is_signaling
Jarkko Hietaniemi [Sat, 7 Feb 2015 18:12:33 +0000 (13:12 -0500)]
infnan: add nan_is_signaling

9 years agoinfnan: add nan_signaling_set
Jarkko Hietaniemi [Sat, 7 Feb 2015 14:29:31 +0000 (09:29 -0500)]
infnan: add nan_signaling_set

9 years agoinfnan: add nan_hibyte
Jarkko Hietaniemi [Sat, 7 Feb 2015 14:27:05 +0000 (09:27 -0500)]
infnan: add nan_hibyte

9 years agoinfnan: do not define NV_NAN from a signaling nan
Jarkko Hietaniemi [Sat, 7 Feb 2015 18:27:42 +0000 (13:27 -0500)]
infnan: do not define NV_NAN from a signaling nan

This is not a strong guarantee that the NV_NAN is a quiet NaN.

9 years agoRemove get-magic from $/
Father Chrysostomos [Sun, 8 Feb 2015 20:45:12 +0000 (12:45 -0800)]
Remove get-magic from $/

and use a different approach to prevent $/ from being set to a bad
value.

This should fix ticket #123739.  Commit v5.21.8-197-g5fe499a made
$/’s get-magic read PL_rs, so that the croak when setting $/ to a
bad value would not leave $/ with that bad value, in order to fix
bug #123218.

Some CPAN modules do not like $/ reading PL_rs that way.  So we
have to change this back.  I am not actually removing the get-
magic, but just making it a no-op, as it was before.  The set-
magic now sets $/ back to its previous value before croaking.

9 years agotest skip under miniperl
Jarkko Hietaniemi [Sun, 8 Feb 2015 13:52:41 +0000 (08:52 -0500)]
test skip under miniperl

9 years agoCorrect grammatical error in Benchmark POD.
James E Keenan [Sun, 8 Feb 2015 03:56:04 +0000 (22:56 -0500)]
Correct grammatical error in Benchmark POD.

Increment $VERSION and add entry to perldelta.

9 years ago[perl #123753] Assert fail with &{+foo} and errors
Father Chrysostomos [Sun, 8 Feb 2015 03:22:00 +0000 (19:22 -0800)]
[perl #123753] Assert fail with &{+foo} and errors

This fixes the problem mentioned in 3c47da3c2e with an op address
being used as flags.  '&' not followed by a identifier was being fed
to the parser with a stale token value, left over from the previous
token that had a value, which might be an op address.  This would
cause the flags on the op to vary randomly.

Usually the rv2cv op created this way is nulled, but if there is a
syntax error it may be freed before that happens.  And it is when the
op is freed that the private flags are checked to make sure no invalid
flags have been set.

The test added to t/op/lex.t used to fail an assertion (for me) more
than half the time, but not always, because the 0x10 bit was being set
in op_private (rv2cv does not use that bit).

9 years agotoke.c: Remove redundant PL_expect assignment
Father Chrysostomos [Sun, 8 Feb 2015 03:10:06 +0000 (19:10 -0800)]
toke.c: Remove redundant PL_expect assignment

As of v5.21.3-105-gc5e7362, force_ident no longer reads the value of
PL_expect, so the assignment can come after it.  And TERM('&') (just
after this if-statement) already assigns XOPERATOR to PL_expect.

9 years agoperly.y: Remove types for '$' and '*'
Father Chrysostomos [Sat, 7 Feb 2015 18:06:39 +0000 (10:06 -0800)]
perly.y: Remove types for '$' and '*'

These two tokens never use their value, and the value is not even set
in toke.c, which means it will contain a junk value from some previous
token.  Removing the types prevents that junk value from being acci-
dentally used.

9 years ago[perl #123753] &\0foo parsing
Father Chrysostomos [Sat, 7 Feb 2015 18:04:40 +0000 (10:04 -0800)]
[perl #123753] &\0foo parsing

Normally the lexer skips over stray nulls, treating them as white-
space.  After a sigil, though, it was getting confused.  While $\0foo
would work and was equivalent to $foo (but did not work for lexicals),
$\0eq was a syntax error.  Some cases of &\0foo would cause assertion
failures or outright buggy behaviour, such as strictures randomly
turning on and off.

There were two problems occurring:
1) Nulls were not being treated as whitespace right after a sigil,
   unlike elsewhere.
2) '&' not followed immediately by an identifier was not getting
   pl_yylval set, so the previous value, which might be an op address,
   was being passed as a flags parameter to an op constructor.  (The
   other sigil tokens never use their values.)

This commit addresses the first of those.  I still need to investigate
whether the second can still cause problems.

9 years agot/op/lex.t: Add comment about the file’s purpose
Father Chrysostomos [Sat, 7 Feb 2015 15:32:19 +0000 (07:32 -0800)]
t/op/lex.t: Add comment about the file’s purpose

9 years agoloc_tools.pl: do a 'require' before module's function call
Karl Williamson [Tue, 27 Jan 2015 18:41:55 +0000 (11:41 -0700)]
loc_tools.pl: do a 'require' before module's function call

This was failing to do the require before testing if the function in the
module existed, so if the require hadn't been done by someone else, it
would show as not existing, and so would fail unnecessarily.

The other fix is to not assume the require has been done, so in the
right circumstances, this could have an undefined function error.  But
all current uses had already done the require, so this bug has yet to
show up.

9 years agoregexec.c: Rmv 2 unused macro parameters.
Karl Williamson [Tue, 27 Jan 2015 05:40:28 +0000 (22:40 -0700)]
regexec.c: Rmv 2 unused macro parameters.

9 years agoFix quoting in new switchd.t test.
Craig A. Berry [Fri, 6 Feb 2015 23:31:43 +0000 (17:31 -0600)]
Fix quoting in new switchd.t test.

Escaped double quotes are not portable, but luckily we don't need
to worry about what is portable as runperl will take care of it for
us if we leave things in its capable hands.

Follow-up to 8d28fc8f69270cc75d9564.

9 years agoGeneralize Carp for non-ASCII platforms
Karl Williamson [Thu, 11 Dec 2014 19:29:49 +0000 (12:29 -0700)]
Generalize Carp for non-ASCII platforms

This includes making some {} optional in arg_regexp.t, as I couldn't get
them to consistently appear.

9 years agoCarp: Fix off-by-one error for early Perl versions
Karl Williamson [Thu, 11 Dec 2014 19:37:01 +0000 (12:37 -0700)]
Carp: Fix off-by-one error for early Perl versions

This error occurred only when running Perl before 5.14, and included DEL
as a printable instead of excluding it.

9 years agoIncrement Carp version to 0.35
Karl Williamson [Fri, 6 Feb 2015 22:10:48 +0000 (15:10 -0700)]
Increment Carp version to 0.35

9 years agoDeparse: Don’t choke on SPECIAL constants
Father Chrysostomos [Wed, 24 Dec 2014 06:34:10 +0000 (22:34 -0800)]
Deparse: Don’t choke on SPECIAL constants

Some modules, e.g., POSIX, create constants in the form of references
to immortals in the stash.  B::Deparse started croaking on these in
v5.21.6-584-g03b8f76.

$ ./perl -Ilib -MO=Deparse -MPOSIX -e0
Can't locate object method "FLAGS" via package "B::SPECIAL" at lib/B/Deparse.pm line 745.
CHECK failed--call queue aborted.

At the same time I fixed the stash-probing code, I also had to fix
deparsing of \!0, which had the same bug.

9 years agoperlvar typo
Father Chrysostomos [Fri, 6 Feb 2015 20:42:34 +0000 (12:42 -0800)]
perlvar typo

9 years agoperlvar: further clarify version number representations and usage
David Golden [Fri, 6 Feb 2015 20:08:21 +0000 (15:08 -0500)]
perlvar: further clarify version number representations and usage

9 years agot/run/locale.t: Remove obsolete comments
Karl Williamson [Fri, 6 Feb 2015 17:34:19 +0000 (10:34 -0700)]
t/run/locale.t: Remove obsolete comments

STDERR is now completely turned off.

9 years agolocale.c: savepv() of getenv()
Karl Williamson [Fri, 6 Feb 2015 17:21:01 +0000 (10:21 -0700)]
locale.c: savepv() of getenv()

See https://rt.perl.org/Public/Bug/Display.html?id=123748.

This also changes a '0' into a FALSE when initializing a boolean, which
I consider clearer.

9 years agolocale.c: Fix comment
Karl Williamson [Fri, 6 Feb 2015 17:18:39 +0000 (10:18 -0700)]
locale.c: Fix comment

9 years ago[perl #123753] Fix assertion failure with map+map
Father Chrysostomos [Fri, 6 Feb 2015 18:14:47 +0000 (10:14 -0800)]
[perl #123753] Fix assertion failure with map+map

ck_grep calls ck_fun, which sets the lower private bits to indicate
the number of operands.  ck_grep usually undoes that, by clobbering
op_private completetly.  If an error has occurred, it doesn’t, so we
may fail an assertion if the lower bits are not expected to be set on
mapstart and grepstart.

9 years ago[perl #123737] Fix assertion failure with 0${
Father Chrysostomos [Fri, 6 Feb 2015 16:25:14 +0000 (08:25 -0800)]
[perl #123737] Fix assertion failure with 0${

S_no_op, which displays ‘Foo found where operator expected’, assumes
that PL_bufptr points to the beginning of the token, but that was not
the case for ${ at the end of a line.  The attempt to read more into
the buffer would make PL_bufptr point to the end of the line.  This
meant it would use a negative string length when generating the
‘(Missing operator before foo?)’ text, only accidentally escaping a
crash.  On debugging builds, it failed an assertion.

9 years agoperlvar: revise $] and $^V with less bias
David Golden [Fri, 6 Feb 2015 11:37:03 +0000 (06:37 -0500)]
perlvar: revise $] and $^V with less bias

9 years agoUpdate Encode to CPAN version 2.70
Chris 'BinGOs' Williams [Fri, 6 Feb 2015 12:00:27 +0000 (12:00 +0000)]
Update Encode to CPAN version 2.70

  [DELTA]

$Revision: 2.70 $ $Date: 2015/02/05 10:53:00 $
! Makefile.PL
  add bin/encguess to EXE_FILES

2.69 2015/02/05 10:35:11
! bin/encguess
  Refactored so that
  * does not depend on non-core module (File::Slurp in particular)
  * PODified document
  * -s "encA encB" to -s encA,encB which is more shell-friendly
  * and more
! MANIFEST
+ bin/encguess
  Pulled: Added CLI wrapper for Encode::Guess
  https://github.com/dankogai/p5-encode/pull/32
! Unicode/Unicode.pm
  Pulled: Bump $VERSION in module changed since Encode-2.60
  https://github.com/dankogai/p5-encode/pull/31

9 years ago[perl #123748] - Add test case for possible getenv/putenv/setenv stomping in perl.c
Matthew Horsfall (alh) [Fri, 6 Feb 2015 03:24:01 +0000 (22:24 -0500)]
[perl #123748] - Add test case for possible getenv/putenv/setenv stomping in perl.c

9 years agoFix setenv() replacement documentation in perlclib
Dagfinn Ilmari Mannsåker [Thu, 5 Feb 2015 21:37:08 +0000 (21:37 +0000)]
Fix setenv() replacement documentation in perlclib

my_putenv doesn't exist, the function is called my_setenv

9 years agoregcomp.c: Warn on [:^posix:] not being in []
Karl Williamson [Thu, 5 Feb 2015 20:07:38 +0000 (13:07 -0700)]
regcomp.c: Warn on [:^posix:] not being in []

A POSIX character class is has to be in a bracketed character class.  A
warning is issued when something appearing to be one is found outside.
Until this commit the warning wasn't raised for negated classes.

9 years agoext/re/re.pm: Fix comment
Karl Williamson [Thu, 5 Feb 2015 15:38:52 +0000 (08:38 -0700)]
ext/re/re.pm: Fix comment

9 years agore.pm: White-space only
Karl Williamson [Wed, 4 Feb 2015 19:34:04 +0000 (12:34 -0700)]
re.pm: White-space only

Fix some indents, vertically align ternary