This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
7 years agot/lib/feature/implicit: Generalize for non-ASCII platforms
Karl Williamson [Tue, 21 May 2013 03:54:01 +0000 (21:54 -0600)]
t/lib/feature/implicit: Generalize for non-ASCII platforms

7 years agot/op/coreamp.t: Generalize for non-ASCII platfomrs
Karl Williamson [Fri, 19 Apr 2013 19:58:12 +0000 (13:58 -0600)]
t/op/coreamp.t: Generalize for non-ASCII platfomrs

7 years agot/re/re_tests: Some tests are platform-specific
Karl Williamson [Thu, 18 Apr 2013 03:49:10 +0000 (21:49 -0600)]
t/re/re_tests: Some tests are platform-specific

7 years agot/io/crlf.t: Generalize for non-ASCII platforms
Karl Williamson [Wed, 17 Apr 2013 14:22:36 +0000 (08:22 -0600)]
t/io/crlf.t: Generalize for non-ASCII platforms

7 years agoext/B/t/b.t: Generalize for non-ASCII platforms
Karl Williamson [Tue, 16 Apr 2013 18:13:07 +0000 (12:13 -0600)]
ext/B/t/b.t: Generalize for non-ASCII platforms

7 years agot/op/warn.t: Generalize for non-ASCII platforms
Karl Williamson [Tue, 16 Apr 2013 17:50:04 +0000 (11:50 -0600)]
t/op/warn.t: Generalize for non-ASCII platforms

7 years agore/reg_email.t: Generalize for non-ASCII platforms
Karl Williamson [Tue, 16 Apr 2013 16:18:02 +0000 (10:18 -0600)]
re/reg_email.t: Generalize for non-ASCII platforms

This replaces all the hard-coded hex character values.  It uses the new
(?[ ]) notation.  I checked that the compiled regex matches the exact
same code points as before these changes.

7 years agoext/XS-APItest/t/svpeek.t: Extend to EBCDIC platforms
Karl Williamson [Sat, 13 Apr 2013 22:19:20 +0000 (16:19 -0600)]
ext/XS-APItest/t/svpeek.t: Extend to EBCDIC platforms

7 years agoext/XS-APItest/t/svpv_magic.t: Generalize for non-ASCII platforms
Karl Williamson [Sat, 13 Apr 2013 22:14:35 +0000 (16:14 -0600)]
ext/XS-APItest/t/svpv_magic.t: Generalize for non-ASCII platforms

7 years agolib/utf8.t: Generalize for non-ASCII platforms
Karl Williamson [Sat, 13 Apr 2013 21:35:52 +0000 (15:35 -0600)]
lib/utf8.t: Generalize for non-ASCII platforms

This includes choosing a different code point that has 3 bytes in both
UTF-8 and UTF-EBCDIC, so that the pos numbers work for both.

7 years agot/uni/parser.t: Extend to EBCDIC platforms
Karl Williamson [Sat, 13 Apr 2013 21:16:44 +0000 (15:16 -0600)]
t/uni/parser.t: Extend to EBCDIC platforms

7 years agot/uni/method.t: Extend to EBCDIC platforms
Karl Williamson [Sat, 13 Apr 2013 20:41:46 +0000 (14:41 -0600)]
t/uni/method.t: Extend to EBCDIC platforms

I couldn't figure out a way to not use the hard-coded values

7 years agot/op/magic.t: Generalize for non-ASCII platforms
Karl Williamson [Sat, 13 Apr 2013 20:26:09 +0000 (14:26 -0600)]
t/op/magic.t: Generalize for non-ASCII platforms

7 years agot/io/through.t: Generalize for EBCDIC platforms
Karl Williamson [Sat, 13 Apr 2013 19:36:41 +0000 (13:36 -0600)]
t/io/through.t: Generalize for EBCDIC platforms

This uses hard-coded values for EBCDIC because of the shell issues

7 years agot/op/goto.t: Generalize for non-ASCII platforms
Karl Williamson [Sun, 7 Apr 2013 16:45:14 +0000 (10:45 -0600)]
t/op/goto.t: Generalize for non-ASCII platforms

7 years agot/re/pat.t: Generalize for EBCDIC
Karl Williamson [Thu, 4 Apr 2013 02:15:17 +0000 (20:15 -0600)]
t/re/pat.t: Generalize for EBCDIC

7 years agot/uni/overload.t: Generalize for non-ASCII platforms
Karl Williamson [Sat, 6 Apr 2013 05:34:50 +0000 (23:34 -0600)]
t/uni/overload.t: Generalize for non-ASCII platforms

7 years agot/uni/method.t: Generalize for non-ASCII platforms
Karl Williamson [Sat, 6 Apr 2013 05:34:13 +0000 (23:34 -0600)]
t/uni/method.t: Generalize for non-ASCII platforms

7 years agot/op/utf8magic.t: Generalize for non-ASCII platforms
Karl Williamson [Sat, 6 Apr 2013 05:33:28 +0000 (23:33 -0600)]
t/op/utf8magic.t: Generalize for non-ASCII platforms

7 years agot/op/evalbytes.t: Generalize for non-ASCII platforms
Karl Williamson [Sat, 6 Apr 2013 05:32:57 +0000 (23:32 -0600)]
t/op/evalbytes.t: Generalize for non-ASCII platforms

7 years agot/op/utfhash.t: Fix to work on EBCDIC 1047
Karl Williamson [Sat, 6 Apr 2013 19:01:54 +0000 (13:01 -0600)]
t/op/utfhash.t: Fix to work on EBCDIC 1047

This .t thought it could have an __END__ in the middle of DATA input,
and the first read would read in up to that, and the second would read
the rest.  In bisecting, I couldn't find a time when this ever worked.
Now this has a marker, and does a split on that marker, choosing the
first or second half depending.

Note that this only works on ASCII and EBCDIC 1047 platforms.  It could
be extended for the other code pages Perl purportedly supports.

7 years agot/re/pat_re_eval.t: Generalize for non-ASCII platforms
Karl Williamson [Tue, 2 Apr 2013 04:29:16 +0000 (22:29 -0600)]
t/re/pat_re_eval.t: Generalize for non-ASCII platforms

7 years agot/op/split.t: EBCDIC fixes
Karl Williamson [Tue, 2 Apr 2013 03:08:20 +0000 (21:08 -0600)]
t/op/split.t: EBCDIC fixes

7 years agore/pat_advanced.t: EBCDIC fixes
Karl Williamson [Tue, 2 Apr 2013 02:43:03 +0000 (20:43 -0600)]
re/pat_advanced.t: EBCDIC fixes

This includes not skipping some EBCDIC that formerly was, since we now
have testing infrastructure that makes this easy.

7 years agot/io/utf8.t: EBCDIC fixes
Karl Williamson [Tue, 2 Apr 2013 02:01:04 +0000 (20:01 -0600)]
t/io/utf8.t: EBCDIC fixes

7 years agot/uni/fold.t: Generalize for non-ASCII platforms
Karl Williamson [Sat, 30 Mar 2013 18:32:09 +0000 (12:32 -0600)]
t/uni/fold.t: Generalize for non-ASCII platforms

7 years agolib/feature/bundle: Generalize for non-ASCII platforms
Karl Williamson [Wed, 27 Mar 2013 22:55:55 +0000 (16:55 -0600)]
lib/feature/bundle: Generalize for non-ASCII platforms

7 years agoXS-APItest/t/fetch_pad_names.t: Skip if EBCDIC
Karl Williamson [Wed, 27 Mar 2013 22:08:04 +0000 (16:08 -0600)]
XS-APItest/t/fetch_pad_names.t: Skip if EBCDIC

This could be ported, but there's a lot of stuff to convert

7 years agoext/XS-APItest/t/utf8.t: Fix so passes EBCDIC
Karl Williamson [Wed, 27 Mar 2013 18:05:53 +0000 (12:05 -0600)]
ext/XS-APItest/t/utf8.t: Fix so passes EBCDIC

This involves skipping much of the tests, because it would be painful to
generalize for the different EBCDIC code pages.

7 years agoext/re/t/re_funcs_u.t: Generalize for non-ASCII platforms
Karl Williamson [Wed, 27 Mar 2013 17:27:06 +0000 (11:27 -0600)]
ext/re/t/re_funcs_u.t: Generalize for non-ASCII platforms

7 years agot/op/print.t: Skip an EBCDIC test
Karl Williamson [Wed, 27 Mar 2013 16:33:44 +0000 (10:33 -0600)]
t/op/print.t: Skip an EBCDIC test

This could be fixed (the values would probably change depending on the
code page), but the code that would get exercised is unlikely to vary
depending on character set.

7 years agoop/chop.t: Fix for EBCDIC
Karl Williamson [Tue, 26 Mar 2013 02:43:38 +0000 (20:43 -0600)]
op/chop.t: Fix for EBCDIC

One test is skipped because the code point is not representable on
EBCDIC platforms.  Other tests are modified to work on EBCDIC.

7 years agot/op/lc.t: Generalize for non-ASCII platforms
Karl Williamson [Tue, 26 Mar 2013 01:56:50 +0000 (19:56 -0600)]
t/op/lc.t: Generalize for non-ASCII platforms

This had code that attempted this, but it was wrong.  The conversion to
EBCDIC must be done before the \U, or similar.

7 years agoSkip some porting tests under EBCDIC
Karl Williamson [Mon, 25 Mar 2013 21:04:14 +0000 (15:04 -0600)]
Skip some porting tests under EBCDIC

EBCDIC won't work on these because of inherent differences from ASCII,
including a different sort order.

For porting/regen.t, we use the shipped parsing rules on EBCDIC platforms

7 years agot/re/regex_sets.t: Generalize for non-ASCII platforms
Karl Williamson [Mon, 25 Mar 2013 20:59:50 +0000 (14:59 -0600)]
t/re/regex_sets.t: Generalize for non-ASCII platforms

7 years agot/op/quotemeta.t: EBCDIC fixes
Karl Williamson [Tue, 19 Mar 2013 21:27:31 +0000 (15:27 -0600)]
t/op/quotemeta.t: EBCDIC fixes

7 years agot/re/fold_grind.t: Generalize for non-ASCII platforms
Karl Williamson [Tue, 19 Mar 2013 17:32:55 +0000 (11:32 -0600)]
t/re/fold_grind.t: Generalize for non-ASCII platforms

7 years agot/uni/class.t: Generalize to work on non-ASCII platforms
Karl Williamson [Tue, 19 Mar 2013 17:20:24 +0000 (11:20 -0600)]
t/uni/class.t: Generalize to work on non-ASCII platforms

7 years agofeature/unicode_strings.t: Generalize to work on non-ASCII platforms
Karl Williamson [Tue, 19 Mar 2013 17:01:57 +0000 (11:01 -0600)]
feature/unicode_strings.t: Generalize to work on non-ASCII platforms

7 years agolib/dumpvar.pl: Generalize for non-ASCII platforms
Karl Williamson [Sun, 2 Nov 2014 03:10:48 +0000 (21:10 -0600)]
lib/dumpvar.pl: Generalize for non-ASCII platforms

7 years agore/charset.t: Generalize for non-ASCII platforms
Karl Williamson [Fri, 15 Mar 2013 17:57:24 +0000 (11:57 -0600)]
re/charset.t: Generalize for non-ASCII platforms

This converts the hard-coded character numbers to native, so will work
on any platform.  It also adds some tests, and improves some test names

7 years agoAPItest/t/handy.t: Generalize for non-ASCII platforms
Karl Williamson [Wed, 13 Mar 2013 22:17:39 +0000 (16:17 -0600)]
APItest/t/handy.t: Generalize for non-ASCII platforms

7 years agot/base/lex.t: Generalize for EBCDIC platforms
Karl Williamson [Mon, 11 Mar 2013 04:17:31 +0000 (22:17 -0600)]
t/base/lex.t: Generalize for EBCDIC platforms

\xE2 is 'S' in EBCDIC, and so is ASCII there.  We need something that is
an alpha on both platforms that isn't ASCII.  \xDF works.

Also, 65 may not be "A" on a non-ASCII platform, so use 65 instead of
'A' where 65 is wanted

7 years agolib/Unicode/UCD.t: White-space only
Karl Williamson [Wed, 26 Jun 2013 22:06:47 +0000 (16:06 -0600)]
lib/Unicode/UCD.t: White-space only

Properly indent within a block

7 years agoperldelta for previous commit (threads upgrade)
Steve Hay [Thu, 5 Mar 2015 23:00:35 +0000 (23:00 +0000)]
perldelta for previous commit (threads upgrade)

7 years agoUpgrade to threads 1.98
Jerry D. Hedden [Thu, 5 Mar 2015 05:28:51 +0000 (00:28 -0500)]
Upgrade to threads 1.98

7 years agolib/Config.t: Skip tests that are invalid on os390
Karl Williamson [Fri, 21 Nov 2014 16:22:53 +0000 (09:22 -0700)]
lib/Config.t: Skip tests that are invalid on os390

7 years agot/comp/require.t: No longer needed to skip on EBCDIC
Karl Williamson [Wed, 29 Oct 2014 16:08:46 +0000 (10:08 -0600)]
t/comp/require.t: No longer needed to skip on EBCDIC

7 years agot/uni/write.t: Don't skip EBCDIC tests
Karl Williamson [Mon, 9 Jun 2014 18:30:23 +0000 (12:30 -0600)]
t/uni/write.t: Don't skip EBCDIC tests

This now passes on os390

7 years agot/lib/warnings/utf8: Update skip message
Karl Williamson [Wed, 26 Jun 2013 21:28:41 +0000 (15:28 -0600)]
t/lib/warnings/utf8: Update skip message

It is not that EBCDIC platforms don't check for malformedness; it is
that a different message gets generated on them, and it's too much
bother to figure it out for each such platform.

7 years agot/test.pl: EBCDIC, utf8 fixes
Karl Williamson [Mon, 2 Mar 2015 22:03:08 +0000 (15:03 -0700)]
t/test.pl: EBCDIC, utf8 fixes

This changes the display of all low-ordinal EBCDIC controls to octal,
instead of just the ones that correspond to the ASCII C0 controls.

It also makes sure that [:print:] thinks all non-ASCII are
non-printable.

7 years agolib/Unicode/UCD.t: Fixes to work on EBCDIC
Karl Williamson [Mon, 2 Mar 2015 22:00:25 +0000 (15:00 -0700)]
lib/Unicode/UCD.t: Fixes to work on EBCDIC

These were broken by the upgrade of Unicode::UCD to version 0.61

7 years agolib/open.t: Fix skip count
Karl Williamson [Thu, 5 Mar 2015 19:08:48 +0000 (12:08 -0700)]
lib/open.t: Fix skip count

7 years agoData::Dumper/t/dumper.t: Fix comments
Karl Williamson [Thu, 5 Mar 2015 17:34:08 +0000 (10:34 -0700)]
Data::Dumper/t/dumper.t: Fix comments

7 years agoreadline should behave as <>, not <<>>
Rafael Garcia-Suarez [Thu, 5 Mar 2015 16:37:33 +0000 (17:37 +0100)]
readline should behave as <>, not <<>>

This fixes bug #123990. The cause was that one promotion to
OP_READLINE was not cleaning the special flag on that op.

7 years agosprinkle NOTREACHED and FALLTHROUGH
David Mitchell [Thu, 5 Mar 2015 11:44:37 +0000 (11:44 +0000)]
sprinkle NOTREACHED and FALLTHROUGH

Coverity complains bitterly about many switch statements in lots of files.

Many of these are of the form:

    case FOO:
        ...
        goto baz;
    case BAR:
        ....

and something as smart as Coverity shouldn't really be complaining about
a missing 'break' when the last statement of the previous branch is an
unconditional goto/return/continue. But I've shoved in a bunch of
'NOTREACHED' to hopefully shut it up.

Missing 'FALLTHROUGH' comments were more reasonable, and I've added them
where appropriate.

The only confusing one was cx_dup(), where the various CXt_LOOP_ branches
all fell through to the next one, and it took a while to figure out that
those weren't bugs.

7 years agopp.c: remove unneeded SPAGAIN's
David Mitchell [Thu, 5 Mar 2015 11:01:01 +0000 (11:01 +0000)]
pp.c: remove unneeded SPAGAIN's

Spotted by Coverity.

I've left the SPAGAIN but commented out, in case future changes
to the code make them needed again.

7 years agodocument why S_maybe_multideref is Coverity-safe
David Mitchell [Thu, 5 Mar 2015 10:28:28 +0000 (10:28 +0000)]
document why S_maybe_multideref is Coverity-safe

7 years agofollowup for MEM_WRAP_CHECK
David Mitchell [Wed, 4 Mar 2015 14:49:22 +0000 (14:49 +0000)]
followup for MEM_WRAP_CHECK

On my previous commit, I failed to save the edited handy.h file where
I had edited the comments, so they were missed from the commit.

7 years agofurther tweak MEM_WRAP_CHECK()
David Mitchell [Wed, 4 Mar 2015 14:22:27 +0000 (14:22 +0000)]
further tweak MEM_WRAP_CHECK()

My recent mods to make it often constant-fold at time-time were
generating Coverity warnings when the expression happened to equal
(cond ? 1 : 1).

7 years agoConsistently use NOT_REACHED; /* NOTREACHED */
Jarkko Hietaniemi [Wed, 4 Mar 2015 12:37:33 +0000 (07:37 -0500)]
Consistently use NOT_REACHED; /* NOTREACHED */

Both needed: the macro is for compilers, the comment for static checkers.

(This doesn't address whether each spot is correct and necessary.)

7 years agoUpgrade Text-Balanced from version 2.02 to 2.03
Steve Hay [Wed, 4 Mar 2015 08:43:41 +0000 (08:43 +0000)]
Upgrade Text-Balanced from version 2.02 to 2.03

This incorporates the blead customizations, with no other changes except
the version bump.

7 years agothreads is no longer customized, as of commit c0ff91434b
Steve Hay [Wed, 4 Mar 2015 08:39:17 +0000 (08:39 +0000)]
threads is no longer customized, as of commit c0ff91434b

7 years agothreads is no longer customized, as of commit c0ff91434b
Steve Hay [Wed, 4 Mar 2015 08:14:20 +0000 (08:14 +0000)]
threads is no longer customized, as of commit c0ff91434b

7 years agoUpgrade to threads 1.97
Jerry D. Hedden [Tue, 3 Mar 2015 23:30:54 +0000 (18:30 -0500)]
Upgrade to threads 1.97

Committer actions: (1) regen for t/porting/customized.dat.
(2) perldelta for update to threads.

7 years agoIRIX: floating point: do not flush to zero
Jarkko Hietaniemi [Wed, 4 Mar 2015 00:15:25 +0000 (19:15 -0500)]
IRIX: floating point: do not flush to zero

Fix for [perl #123767] IRIX64 blead (ddce084a) opbasic/arith.t failure

Use the PERL_SYS_FPU_INIT to initialize the FPU flags appropriately.

7 years agoMake MEM_WRAP_CHECK more compile-time
David Mitchell [Thu, 26 Feb 2015 18:42:16 +0000 (18:42 +0000)]
Make MEM_WRAP_CHECK more compile-time

MEM_WRAP_CHECK(n,t) checks whether n * sizeof(t) exceeds the
memory size, and so is likely to wrap.

When the type of n is small (e.g. a U8), you used to get compiler warnings
about a comparison always being true. This was avoided by adding 0.0. Now
Coverity complains that you're doing a floating-point comparison with the
results of an integer division.

Instead of adding 0.0, instead add some more compile-time checks
that will cause the runtime check to be skipped when the maximum value
of n (as determined by sizeof(n)) is a lot less than memory size.

On my 64-bit system this also pleasingly makes the executable 8384 bytes
smaller, implying that in many cases, the run-time check is now being
skipped.

7 years agoTru64: living dangerously, enabling the -c99 flag for cc
Jarkko Hietaniemi [Tue, 3 Mar 2015 01:46:53 +0000 (20:46 -0500)]
Tru64: living dangerously, enabling the -c99 flag for cc

16 years after C99 and 2 years after Tru64 EOL.

7 years agoRemove unused variable $DEBUGGING.
James E Keenan [Thu, 26 Feb 2015 14:02:19 +0000 (09:02 -0500)]
Remove unused variable $DEBUGGING.

It is unused and there do not appear to be any tests to be run for -DDEBUGGING
in this file.

7 years agoBump Locale-Codes from 3.33 to 3.34
Sullivan Beck [Mon, 2 Mar 2015 23:37:20 +0000 (18:37 -0500)]
Bump Locale-Codes from 3.33 to 3.34

The core modules Locale::Country, Locale::Language, and Locale::Currency (all
part of the Locale-Codes distribution) should be updated on a regular basis.
They contain "codes" from various Internet standards which change over time.

7 years agoregen uconfig.h
David Mitchell [Mon, 2 Mar 2015 15:50:09 +0000 (15:50 +0000)]
regen uconfig.h

Needed after 0cd93aca4e274765.

7 years agoConfigure: add note about nvsize sometimes lying
Jarkko Hietaniemi [Mon, 2 Mar 2015 12:00:33 +0000 (07:00 -0500)]
Configure: add note about nvsize sometimes lying

Lying in case you expect that many bytes being used for NV.

7 years ago[perl #123960] sv.c: Fix gp_free -Do output
Father Chrysostomos [Mon, 2 Mar 2015 06:42:04 +0000 (22:42 -0800)]
[perl #123960] sv.c: Fix gp_free -Do output

We try to print ‘gp_free clearing PL_stashcache for '%"HEKf"'’, but
without checking that we actually have a hek.  This has been this way
since 103f5a36127.

7 years agoperldelta for b6bba8869651
Tony Cook [Mon, 2 Mar 2015 06:10:15 +0000 (17:10 +1100)]
perldelta for b6bba8869651

7 years ago[perl #123947] deparse $#_ as $#_ not as $#{_}
Tony Cook [Mon, 2 Mar 2015 06:03:12 +0000 (17:03 +1100)]
[perl #123947] deparse $#_ as $#_ not as $#{_}

8c2e27d changed B::Deparse to deparse $#{1} as that instead of as $#1
which is a syntax error, but also changed $#_ to deparse as $#{_}
which isn't necessary, and broke GFUJI/macro-0.06.tar.gz

This could be considered a bug in macro.pm, but since we don't need to
deparse $#_ as $#{_} let's not do that.

7 years ago[perl #123849] sv.c: Fix sv_clear -Do output
Father Chrysostomos [Mon, 2 Mar 2015 02:20:53 +0000 (18:20 -0800)]
[perl #123849] sv.c: Fix sv_clear -Do output

We try to print ‘sv_clear clearing PL_stashcache for '%"SVf"'’, but
the sv here is a hash, and we can’t do SvPV on it.  We need the hash’s
name.  This has been this way since 103f5a36127.

7 years ago[perl #123955] Fix assert fail with 0 s/// in quotes
Father Chrysostomos [Mon, 2 Mar 2015 02:11:23 +0000 (18:11 -0800)]
[perl #123955] Fix assert fail with 0 s/// in quotes

This is related to bug #123617 and is a follow-up to eabab8bcc.

This code:

"@0{0s 000";eval"$"

begins tokenisation as follows:

stringify ( join ( $ " , @ 0 { 0 subst

When seeing the subst after the 0, the parser discards many tokens and
we end up at the ; outside the quotes.

Since PL_lex_stuff (the temporary spot for storing the contents of a
quote-like operator) is localised as of eabab8bcc, we end up with just
PL_sublex_info.repl (the temporary spot for storing the replacement
part) set.  Since it is still set when we get to the next double-
quote, it is treated as a two-part quote-like operator, like y or s.
That can’t happen, and we have assertions to make sure of it.

We need to localise PL_sublex_info.repl as well, so it gets freed
properly when scopes are popped after an error.

7 years ago[perl #123848] Allow OPpTARGET_MY on qr
Father Chrysostomos [Sun, 1 Mar 2015 22:01:27 +0000 (14:01 -0800)]
[perl #123848] Allow OPpTARGET_MY on qr

// in the scope of lexical $_ gets the OPpTARGET_MY flag set.  If it
is used as an operand to smartmatch, it gets converted to a qr op.
There is no need to turn off the flag, since it is harmless at run
time.  But we need to allow the flag on this op type to avoid asser-
tion failures when it is freed.

7 years agoop.c apidoc typo
Father Chrysostomos [Sun, 1 Mar 2015 21:27:39 +0000 (13:27 -0800)]
op.c apidoc typo

7 years ago[perl #123821] Fix assert fail with \(&$0)=0
Father Chrysostomos [Sun, 1 Mar 2015 21:26:52 +0000 (13:26 -0800)]
[perl #123821] Fix assert fail with \(&$0)=0

If the operand of a reference constructor that is assigned to is not
valid, then S_lvref (in op.c) queues an error and does not bother to
convert the op into an lvref op.  This causes problems, since we have
already set lvref-specific flags on the op in the expectation that its
type will change.  We get assertion failures later when freeing the
op, because of the invalid flags.

Instead of bailing out when we have an error like this, just continue
processing it, as we do in many other places.

7 years ago[perl #123817] Assert fail with attr in anon hash
Father Chrysostomos [Sun, 1 Mar 2015 21:16:36 +0000 (13:16 -0800)]
[perl #123817] Assert fail with attr in anon hash

These two one-liners were failing an assertion:

$y = { my $x : m }
$y = [ (my $x : m) ]

The lexical with an attribute was turning into an op of type ‘list’
with the OPpLVAL_INTRO flag set.  Many op constructors convert an
operand that is of type ‘list’ into the correct type, instead of
creating a new op to wrap around it.  Other ops were not expecting the
flag to be set, causing an assertion failure.  The easiest solution is
to turn off the flag in op_convert_list, which is where the op type
changes.  (I tried modifying other op types to accept the flag, but
that caused problems for B::Deparse, which inquires of B::Op_private
which ops can legitimately take that flag.)

7 years agoop.c: Remove redundant op_lvalue call
Father Chrysostomos [Sun, 1 Mar 2015 19:43:11 +0000 (11:43 -0800)]
op.c: Remove redundant op_lvalue call

Refgen ops already call op_lvalue on their operands.  Calling it
beforehand causes it to be called twice, which is harmless, but
wasteful.

7 years ago[perl #123802] Assertion failure with "\L\L"
Father Chrysostomos [Sun, 1 Mar 2015 19:29:10 +0000 (11:29 -0800)]
[perl #123802] Assertion failure with "\L\L"

This is a follow-up to f4460c6f7a.  The check to see whether we are
in a quote-like operator needs to come before the call to sublex_done,
as sublex_done is just as problematic as doing SvIVX on a PV.  (See
479ae48e22f for details on why.)  Checking the type of PL_linestr is
not a reliable way to see whether we are in a quote-like op, so use
PL_in_what instead.

7 years agot/op/lex.t: Correct bug num
Father Chrysostomos [Sun, 1 Mar 2015 19:20:47 +0000 (11:20 -0800)]
t/op/lex.t: Correct bug num

7 years ago[perl #123763] Clear target on my $_; split
Father Chrysostomos [Sun, 1 Mar 2015 06:31:25 +0000 (22:31 -0800)]
[perl #123763] Clear target on my $_; split

If a lexical $_ is in scope, then the first argument to split, which
starts out as a match op, will get the pad offset of $_ as its target,
since that’s how implicit lexical $_=~ usually works.

ck_split changes that first argument to a pushre op.  The target
was not being cleared.  That did not cause any problems, until
v5.21.4-408-gfd017c0, which optimised lexical @array = split to write
to split @array directly, by storing making lexical array’s pad offset
the pushre’s target.

You can see the obvious conflict there.  We end up trying to split to
$_, which is not an array.  On a debugging build, you get an assertion
failure when trying to extend $_.  Make the split list long enough,
and you get a crash on non-debugging builds.

debugging$ ./miniperl -e 'my $_; split'
Use of my $_ is experimental at -e line 1.
Assertion failed: (SvTYPE(av) == SVt_PVAV), function Perl_av_extend, file av.c, line 70.

non-debugging$ ./miniperl -e 'my $_; split //, "a"x100000'
Use of my $_ is experimental at -e line 1.
Segmentation fault: 11

7 years agoTest for split after my $_ [perl #123763]
Father Chrysostomos [Sun, 1 Mar 2015 06:12:30 +0000 (22:12 -0800)]
Test for split after my $_ [perl #123763]

7 years ago[perl #123763] pushre needs to permit OPpTARGET_MY
Hugo van der Sanden [Sun, 1 Mar 2015 02:58:58 +0000 (18:58 -0800)]
[perl #123763] pushre needs to permit OPpTARGET_MY

This case fails an assertion:

my($_);0=split

because a pushre op is not expected to have that flag.  A pushre op
starts out as a match op (which may indeed have the flag set), as is
subsequently converted to a pushre op.

[The commit message was written by the committer.]

7 years ago[perl #123802] Assertion failure with /$0{}/
Father Chrysostomos [Sun, 1 Mar 2015 01:41:36 +0000 (17:41 -0800)]
[perl #123802] Assertion failure with /$0{}/

If the parser (perly.c) pops tokens when encountering a syntax error,
it can pop inner lexing scopes (which handle the contents of quote-
like operators).

If there is a pending token on the pending token stack, then the cur-
rent lexing state is LEX_KNOWNEXT.  It usually gets set to a pending
value stored in PL_lex_defer when the last pending token is emitted.

If scopes are exited when there is a pending token, then the state is
reset, since it is localised, even thought we still have a token pend-
ing.  We have code to account for that and still emit the pending
token.  (See 7aa8cb0dec1.)  But the pending lexing state is still
used after the pending token is emitted.  So we can end up with
LEX_INTERPEND when there is no inner lexing scope.

LEX_INTERPEND will cause sublex_done (in toke.c) to be called, which
does a LEAVE.  If the current scope does not belong to it, we end up
exiting a scope set up by the parser, which frees the parser stack
(via SAVEDESTRUCTOR_X and clear_yystack in perly.c).  The parser is
still using the stack, which holds reference counts on the CV in
PL_compcv, so reference counts get screwed up.

We need to check whether we have a proper lexing scope set up if the
lexing state is LEX_INTERPEND.

This is a follow-up to f4460c6f7a, which was a similar bug, but
occurred with LEX_INTERPCONCAT, rather than LEX_INTERPEND.

7 years agoinfnan: NV_MANT_REAL_DIG is unused
Jarkko Hietaniemi [Fri, 27 Feb 2015 21:37:57 +0000 (16:37 -0500)]
infnan: NV_MANT_REAL_DIG is unused

(now that the nan payload code is gone)

7 years agofix to "fix op leak caused by OP_MULTIDEREF"
David Mitchell [Fri, 27 Feb 2015 21:06:13 +0000 (21:06 +0000)]
fix to "fix op leak caused by OP_MULTIDEREF"

Update to b7613b8a45c70113.

Hugo pointed out that my for(; p; p = OpSIBLING(p)) op_free(p) loop
relied on p->op_sibling still being valid after op_free(p).

7 years agoRevert "perlpod and spec: s/Latin-1/CP-1252/"
Karl Williamson [Fri, 27 Feb 2015 18:57:03 +0000 (11:57 -0700)]
Revert "perlpod and spec: s/Latin-1/CP-1252/"

This reverts commit e2bb786192adfa315ea974b5f630d7040aa6f6ac.

These doc changes apply to Pod::Simple version 3.30, which, alas,  was
created too late to be included in Perl v5.22, so this change to the
docs in blead is premature.

I plan to apply the patch in 5.23.

7 years agoperlpod and spec: s/Latin-1/CP-1252/
Ricardo Signes [Fri, 27 Feb 2015 03:35:52 +0000 (22:35 -0500)]
perlpod and spec: s/Latin-1/CP-1252/

7 years agoNo Scalar::Util under fresh miniperl.
Jarkko Hietaniemi [Fri, 27 Feb 2015 03:09:55 +0000 (22:09 -0500)]
No Scalar::Util under fresh miniperl.

7 years agoinfnan: one should not define NV_NAN from NV_SNAN
Jarkko Hietaniemi [Fri, 27 Feb 2015 01:37:16 +0000 (20:37 -0500)]
infnan: one should not define NV_NAN from NV_SNAN

More generally, the NaN should be the quiet one.

7 years agoinfnan: drop NV_QNAN and NV_SNAN
Jarkko Hietaniemi [Fri, 27 Feb 2015 01:30:02 +0000 (20:30 -0500)]
infnan: drop NV_QNAN and NV_SNAN

They are unused, better keep the API small.

7 years agodo_op_dump(): handle unknown op_private enums
David Mitchell [Thu, 26 Feb 2015 15:44:04 +0000 (15:44 +0000)]
do_op_dump(): handle unknown op_private enums

Where a bitfield value in op_private doesn't correspond to any enums,
do_op_dump() is supposed to display the value as an integer (with
optional LABEL= prefix). Concise does this, do_op_dump was failing to
do this, and instead trying to display the value symbolically as string at
offset -1 in PL_op_private_labels.

This wasn't important yet as no ops currently have an unspecified enum
value.

Spotted by Coverity.

7 years agoinit a var in sv_clear() to keep Coverity happy.
David Mitchell [Thu, 26 Feb 2015 14:31:55 +0000 (14:31 +0000)]
init a var in sv_clear() to keep Coverity happy.

When a new hash is found to iterate over, the old value of hash_index (if
any) is temporarily saved (in the new hash), then restored after the hash
has been iterated over.
This means that the first hash encountered causes the random initial
value of hash_index to be saved and then restored. This is perfectly
harmless, but makes Coverity unhappy. Since other such tools might also
in future detect such dabbling with uninitialised values, its simplest
(but unnecessary) to initialise this var to zero.

7 years agofix op leak caused by OP_MULTIDEREF
David Mitchell [Thu, 26 Feb 2015 12:59:16 +0000 (12:59 +0000)]
fix op leak caused by OP_MULTIDEREF

[perl #123922]

When converting a subtree like

    aelem
      |
    rv2av
      |
    rv2sv - const
      |
     gv

into

    ex-aelem
      |
    multideref
      |
    ex-gv

it was freeing the excised subtree, but failed to free the index
expression (the const in this case).

7 years agorestate -Dx dumping top-level subs
David Mitchell [Thu, 26 Feb 2015 11:50:19 +0000 (11:50 +0000)]
restate -Dx dumping top-level subs

Commit v5.21.3-638-g2eaf799 made compiled subs that don't have :: in their
name be stored in stashes as refs to CVs rather than as GVs. This
indirectly stopped perl -Dx from dumping such subs.

This commit reinstates the old behaviour by making
Perl_dump_packsubs_perl() upgrade the stash entry to a GV when it finds
an RV->CV.

7 years agoinfnan: salvage some docs from the too-late nan work
Jarkko Hietaniemi [Thu, 26 Feb 2015 03:51:12 +0000 (22:51 -0500)]
infnan: salvage some docs from the too-late nan work