perl.git
22 months agoBump to RC1 v5.24.3-RC1
Steve Hay [Sun, 10 Sep 2017 14:12:48 +0000 (15:12 +0100)] 
Bump to RC1

22 months ago5.24.3-RC1 and 5.26.1-RC1 today
Steve Hay [Sun, 10 Sep 2017 14:09:34 +0000 (15:09 +0100)] 
5.24.3-RC1 and 5.26.1-RC1 today

(cherry picked from commit e7e2882183de6169a99f52dec6fe0fb7fd003b3a)

22 months agoFinalize perldelta
Steve Hay [Sun, 10 Sep 2017 14:05:43 +0000 (15:05 +0100)] 
Finalize perldelta

22 months agoperldelta for 96c83ed78a, 2be4edede4 and 8586647e33
Steve Hay [Sun, 10 Sep 2017 12:18:50 +0000 (13:18 +0100)] 
perldelta for 96c83ed78a2be4edede4 and 8586647e33

(cherry picked from commit d1107db027ad52d2f50e348218625a8e122ca9eb)

22 months ago(perl #131665) avoid a buffer overflow in a buffer we didn't need
Tony Cook [Thu, 27 Jul 2017 00:12:02 +0000 (10:12 +1000)] 
(perl #131665) avoid a buffer overflow in a buffer we didn't need

since Lookup() treats its argument as NUL or '=' terminated.

Previously environment variable names longer than the size of the
buffer would result in a buffer overflow.

(cherry picked from commit 8586647e338e8eb42c00fe6f687105c9b8a36d44)

22 months agoPATCH: [perl #131598]
Karl Williamson [Fri, 25 Aug 2017 17:33:58 +0000 (11:33 -0600)] 
PATCH: [perl #131598]

The cause of this is that the vFAIL macro uses RExC_parse, and that
variable has just been changed in preparation for code after the vFAIL.
The solution is to not change RExC_parse until after the vFAIL.

This is a case where the macro hides stuff that can bite you.

(cherry picked from commit 2be4edede4ae226e2eebd4eff28cedd2041f300f)

22 months agoregcomp [perl #131582]
Karl Williamson [Wed, 21 Jun 2017 17:33:37 +0000 (11:33 -0600)] 
regcomp [perl #131582]

(cherry picked from commit 96c83ed78aeea1a0496dd2b2d935869a822dc8a5)

22 months agoIgnore a test module in cmpVERSION.pl
Steve Hay [Sat, 9 Sep 2017 18:24:35 +0000 (19:24 +0100)] 
Ignore a test module in cmpVERSION.pl

(manually cherry picked from commit 9de35bb263b4599827a76615d5e6ef08fb7e32c6)

22 months agoperldelta - Tidy-ups
Steve Hay [Sat, 9 Sep 2017 17:43:52 +0000 (18:43 +0100)] 
perldelta - Tidy-ups

22 months agoperldelta - Remove boilerplate except Security and Acknowledgements
Steve Hay [Sat, 9 Sep 2017 17:12:21 +0000 (18:12 +0100)] 
perldelta - Remove boilerplate except Security and Acknowledgements

22 months agoperldelta - Update Modules
Steve Hay [Sat, 9 Sep 2017 17:03:10 +0000 (18:03 +0100)] 
perldelta - Update Modules

22 months agoperldelta - Update with selected bug fixes etc
Steve Hay [Sat, 9 Sep 2017 10:53:17 +0000 (11:53 +0100)] 
perldelta - Update with selected bug fixes etc

22 months agoUpdate epigraphs.pod for 5.27.3 release
Matthew Horsfall [Mon, 21 Aug 2017 20:53:53 +0000 (16:53 -0400)] 
Update epigraphs.pod for 5.27.3 release

(cherry picked from commit f2b406d8fb1eacbc7d1c4431e773cc5a18aed3c5)

22 months agoAdd epigraph for 5.27.2
Aaron Crane [Thu, 20 Jul 2017 19:38:09 +0000 (20:38 +0100)] 
Add epigraph for 5.27.2

(cherry picked from commit 17335434157774f03e762d9b48f74af2d8526158)

22 months agoUpdate perlhist.pod for new release
Matthew Horsfall [Mon, 21 Aug 2017 20:00:38 +0000 (16:00 -0400)] 
Update perlhist.pod for new release

(cherry picked from commit 7c9c5138c6a704d1caf5908650193f777b81ad23)

22 months agoAdd 5.27.2 to perlhist
Aaron Crane [Thu, 20 Jul 2017 18:29:51 +0000 (19:29 +0100)] 
Add 5.27.2 to perlhist

(cherry picked from commit cf07591c56a81be8313edfa55671e8e741db95b3)

22 months agoAdd perldelta for 5.22.4
Steve Hay [Fri, 8 Sep 2017 19:59:19 +0000 (20:59 +0100)] 
Add perldelta for 5.22.4

(manually cherry picked from commit 50d330d7156d8ec3d4b839db84d2d67832ce322b)

22 months agoUpdate Module::CoreList with data so far for the imminent 5.24.3
Steve Hay [Fri, 8 Sep 2017 19:50:46 +0000 (20:50 +0100)] 
Update Module::CoreList with data so far for the imminent 5.24.3

(Porting/corelist.pl, plus $VERSION bumps and Changes entry for a tentative
release date which is to coincide with a 5.26.1 release)

22 months agoUpdate Module::CoreList %released for 5.27.3
Matthew Horsfall [Mon, 21 Aug 2017 19:51:02 +0000 (15:51 -0400)] 
Update Module::CoreList %released for 5.27.3

(cherry picked from commit e49cf9b2cd73d9276c52789fa57ac83cca86d56c)

22 months agoUpdate Module::CoreList for release
Matthew Horsfall [Mon, 21 Aug 2017 19:49:50 +0000 (15:49 -0400)] 
Update Module::CoreList for release

(cherry picked from commit e94c222158340ba9632da54fbdee10c9c87afecc)

22 months agoBump Module::CoreList version
Matthew Horsfall [Mon, 21 Aug 2017 19:48:02 +0000 (15:48 -0400)] 
Bump Module::CoreList version

(cherry picked from commit 73101150e6723b24cefa13dd93fad09574b030a8)

22 months agoBump Perl version from 5.27.2 to 5.27.3
Aaron Crane [Fri, 8 Sep 2017 19:40:25 +0000 (20:40 +0100)] 
Bump Perl version from 5.27.2 to 5.27.3

Including the various pieces of Module::CoreList.

(manually cherry picked from commit 56c35cf6201e8e4c101fea1c8bc4878b17afd323)

22 months agoUpdate Module::CoreList for 5.27.2
Aaron Crane [Thu, 20 Jul 2017 17:32:44 +0000 (18:32 +0100)] 
Update Module::CoreList for 5.27.2

(cherry picked from commit 7ffcba09210c5ac9cf586fdcd9c88aa0f4166bd8)

22 months agoImport Module::CoreList data for 5.22.4
Steve Hay [Fri, 8 Sep 2017 19:36:53 +0000 (20:36 +0100)] 
Import Module::CoreList data for 5.22.4

(cherry picked from commit e029cc954c72caa0918e0bf43d28790b08ab0c30)

22 months agoImpending 5.27.2 release will be 20 July, not 22 June
Steve Hay [Thu, 29 Jun 2017 16:49:45 +0000 (17:49 +0100)] 
Impending 5.27.2 release will be 20 July, not 22 June

(cherry picked from commit 59b1919d934677201186e6267d61208f8f1ac94a)

22 months agoModule-CoreList/Changes for 5.20170622
Eric Herman [Fri, 8 Sep 2017 19:31:22 +0000 (20:31 +0100)] 
Module-CoreList/Changes for 5.20170622

(cherry picked from commit d4a536238812d77cbbf90c75e785f7865401ab09)

22 months agoupdate Module::CoreList to reflect v5.27.2
Eric Herman [Fri, 8 Sep 2017 19:28:24 +0000 (20:28 +0100)] 
update Module::CoreList to reflect v5.27.2

Note that porting tests pass again.

(cherry picked from commit 0db2672356abafc48b077da67b5beed8106d1b80)

22 months agoBump version to 5.24.3, ahead of its impending release
Steve Hay [Fri, 8 Sep 2017 18:56:34 +0000 (19:56 +0100)] 
Bump version to 5.24.3, ahead of its impending release

(includes regen/opcode.pl)

22 months agoavoid a memory wrap in sv_vcatpvfn_flags()
David Mitchell [Mon, 8 May 2017 20:06:38 +0000 (21:06 +0100)] 
avoid a memory wrap in sv_vcatpvfn_flags()

RT #131260

When calculating the new size of PL_efloatbuf, avoid wrapping 'need'.

(cherry picked from commit ddb03b72f46eae3c278f28e8758e87b9c98c66a1)

22 months agomake _GNU-ish function declarations visible on cygwin
Tony Cook [Fri, 28 Jul 2017 05:19:46 +0000 (15:19 +1000)] 
make _GNU-ish function declarations visible on cygwin

The lack of this caused several test failures on cygwin64, the one case
I tracked down involved memmem() which is a GNU extension that cygwin
supports.

Since the compiler couldn't see the memmem() prototype it treated it's
return value as int, which was then cast to (char *) preventing any
type-mismatch warning, but since int is 32-bits and (char *) on
cygwin64, the upper 32-bits of the pointer was cleared, resulting in a
crash.

After adding this a test cygwin64 build went from 30 or so test failures
to one.

(cherry picked from commit fd998cbffc88a8e50fa34259c36a8db338168383)

22 months ago[perl #131726] [Win32] perl.h remaps 'strtoll' and 'strtoull' incorrectly
Steve Hay [Thu, 27 Jul 2017 17:13:13 +0000 (18:13 +0100)] 
[perl #131726] [Win32] perl.h remaps 'strtoll' and 'strtoull' incorrectly

Fix by Kai-Uwe Eckhardt <kuehro [...] posteo.de> taken from
https://rt.cpan.org/Public/Bug/Display.html?id=121683
as suggested by Sisyphus on perl#131726.

(cherry picked from commit 8ed77d12c9275cd4e145ab50aaecf69730166a9b)

22 months agoPerl_my_vsnprintf: avoid compiler warning
David Mitchell [Tue, 21 Jun 2016 13:22:16 +0000 (14:22 +0100)] 
Perl_my_vsnprintf: avoid compiler warning

in the usequadmath branch, gcc is too clever for its own good:

    PERL_UNUSED_ARG(ap);

gives:

util.c:5299:18: warning: ‘sizeof’ on array function parameter ‘ap’ will
return size of ‘__va_list_tag *’ [-Wsizeof-array-argument]

Stick in a void* cast to shut it up.

(cherry picked from commit bf49eae4014ca7ff7b44362d99251f5b9f30bec8)

22 months agoRegression test for RT #129196
Dan Collins [Sun, 4 Sep 2016 18:43:41 +0000 (14:43 -0400)] 
Regression test for RT #129196

(cherry picked from commit a6128716d2cc20147851e0a37768376647bd3242)

23 months agoperldelta - Correct a perl version
Steve Hay [Fri, 11 Aug 2017 07:35:53 +0000 (08:35 +0100)] 
perldelta - Correct a perl version

It was the fchown() change *reversion* that was in 5.25.4 (dd1dbff095). The
original change (f95ba548a2) was in 5.23.8, first released in stable form
in 5.24.0.

23 months agoperldelta - [perl #128888] was fixed by the cherry-pick of 82229f9f47
Steve Hay [Fri, 11 Aug 2017 07:26:14 +0000 (08:26 +0100)] 
perldelta - [perl #128888] was fixed by the cherry-pick of 82229f9f47

23 months agoperldelta tweaks imported from perl5260delta.pod
Steve Hay [Fri, 11 Aug 2017 07:24:22 +0000 (08:24 +0100)] 
perldelta tweaks imported from perl5260delta.pod

23 months agoperldelta - List tickets resolved by the Time::HiRes upgrade
Steve Hay [Thu, 10 Aug 2017 13:03:33 +0000 (14:03 +0100)] 
perldelta - List tickets resolved by the Time::HiRes upgrade

23 months agoperldelta for VMS configure.com change
Craig A. Berry [Thu, 10 Aug 2017 12:58:57 +0000 (13:58 +0100)] 
perldelta for VMS configure.com change

(taken from commit 29ce4d71249be11f0777ec24bb50a2df7b5c9ed8)

23 months agoperldelta for #129122
Stevan Little [Thu, 10 Aug 2017 12:47:10 +0000 (13:47 +0100)] 
perldelta for #129122

(taken from commit 2c4879e2628d6fa5a764e130f610deaff6f859a5)

23 months agoperldelta for #129196 / 9bde56224
Father Chrysostomos [Wed, 14 Sep 2016 05:57:22 +0000 (22:57 -0700)] 
perldelta for #129196 / 9bde56224

(cherry picked from commit 046a081fb2198b60a2d9a40f1d9b0ceaab7f86e2)

23 months agoperldelta for the many hexfp fixes.
Jarkko Hietaniemi [Thu, 18 Aug 2016 23:19:17 +0000 (19:19 -0400)] 
perldelta for the many hexfp fixes.

(cherry picked from commit 7d897bd0d938ac3c489af290b9289d016bf9fbbe)

23 months agoperldelta for #128734
Karl Williamson [Thu, 10 Aug 2017 12:43:51 +0000 (13:43 +0100)] 
perldelta for #128734

(taken from commit 4690a2e02d47daf03446be6bc0143d8aa16bdb9f)

23 months agoperldelta for #128951 / bf8a9a15
Father Chrysostomos [Sat, 20 Aug 2016 05:10:57 +0000 (22:10 -0700)] 
perldelta for #128951 / bf8a9a15

(cherry picked from commit bc7bbd314b9de6da4e0b8bf6a3c1ced7645acc76)

23 months agoperldelta for dd1dbff0
Jarkko Hietaniemi [Wed, 17 Aug 2016 00:34:49 +0000 (20:34 -0400)] 
perldelta for dd1dbff0

(cherry picked from commit 4b99cb86e7a8b76f83ce83aee0cf4408124de956)

23 months agoperldelta for #126482 / c82de78e3ba
Father Chrysostomos [Tue, 16 Aug 2016 18:25:03 +0000 (11:25 -0700)] 
perldelta for #126482 / c82de78e3ba

(cherry picked from commit c61c589cfa68dccf52432ac2d8e084ba49a4da14)

23 months agoperldelta for #128740 / d35c1b5e4
Father Chrysostomos [Tue, 16 Aug 2016 01:07:43 +0000 (18:07 -0700)] 
perldelta for #128740 / d35c1b5e4

(cherry picked from commit 07cfdfcca3021c09562f56f55514b4b701b04fc9)

23 months agoperldelta for #126203, #128538, #128170 etc
Steve Hay [Thu, 10 Aug 2017 12:39:06 +0000 (13:39 +0100)] 
perldelta for #126203, #128538, #128170 etc

(taken from commit 6674eaad9d86fa0393c493f5ee6fdd200efa8243)

23 months agoperldelta for a2637ca0a / #128597
Father Chrysostomos [Sun, 17 Jul 2016 19:42:05 +0000 (12:42 -0700)] 
perldelta for a2637ca0a / #128597

(cherry picked from commit 44bcb1772d5812694380d8a504e2ad98c3097cf4)

23 months agoperldelta for #128508 / b3dd0aba3
Father Chrysostomos [Sun, 17 Jul 2016 19:24:30 +0000 (12:24 -0700)] 
perldelta for #128508 / b3dd0aba3

(cherry picked from commit b05a99b8c3fe8c592c0fcd1e83598f608f0fd709)

23 months agoperldelta for #128313
Yves Orton [Thu, 10 Aug 2017 12:32:32 +0000 (13:32 +0100)] 
perldelta for #128313

(taken from commit 13e1fc6ad5f61be7a02b000114901d1d850e988f)

23 months agoperldelta for 3f6b66c14467
Tony Cook [Thu, 16 Jun 2016 05:12:46 +0000 (15:12 +1000)] 
perldelta for 3f6b66c14467

(cherry picked from commit f32855156936eaf820046ce5030eea8ab1cc758d)

23 months agoperldelta for 76734a3218e / #128204
Father Chrysostomos [Sun, 19 Jun 2016 07:36:27 +0000 (00:36 -0700)] 
perldelta for 76734a3218e / #128204

(cherry picked from commit 3b58a017360a47c8b94fbef2d6d902c41ad62f51)

23 months agoperldelta for #128131 and #127952
Aaron Crane [Thu, 10 Aug 2017 12:25:14 +0000 (13:25 +0100)] 
perldelta for #128131 and #127952

(taken from commit 4de751aa8a27866a3e6ceb6f13d09e9cba8ace55)

23 months agoperldelta for 08f800f85 / #128182
Father Chrysostomos [Thu, 19 May 2016 03:14:26 +0000 (20:14 -0700)] 
perldelta for 08f800f85 / #128182

(cherry picked from commit f8591e0813fb09e721ebd16e2001516b6c4e7356)

23 months agoperldelta for #128171, #128106 and #128086
Father Chrysostomos [Thu, 10 Aug 2017 12:18:41 +0000 (13:18 +0100)] 
perldelta for #128171, #128106 and #128086

(taken from commit 69ab4fe8f8c211a9fd29de8fa46380ce5ee4eb70)

23 months agoTest data mistake was masked by mistaken fractional matching
Jarkko Hietaniemi [Mon, 15 Aug 2016 21:49:51 +0000 (17:49 -0400)] 
Test data mistake was masked by mistaken fractional matching

(Affected only double-double.)

(cherry picked from commit 1bee6aebe39da1a4d681e8ea1b9d0329898a8407)

23 months agoDo not deploy the fractional matching without fractions
Jarkko Hietaniemi [Mon, 15 Aug 2016 21:52:17 +0000 (17:52 -0400)] 
Do not deploy the fractional matching without fractions

(cherry picked from commit dd1645173d8209e05c419b0f3edc9b1c0f9643a8)

23 months agoTest subnormals with quadmath
Jarkko Hietaniemi [Thu, 18 Aug 2016 01:37:07 +0000 (21:37 -0400)] 
Test subnormals with quadmath

(cherry picked from commit de1a8b537348227e83c8efd15d3cb36d9ac646f5)

23 months agoDefine Perl_fp_class() for quadmath
Jarkko Hietaniemi [Thu, 18 Aug 2016 01:16:16 +0000 (21:16 -0400)] 
Define Perl_fp_class() for quadmath

More importantly, define Perl_fp_class_denorm()
so that hexfp subnormals work with printf %a.

(cherry picked from commit b28053d1f063cb783e73b0596d1f58a21681fda6)

23 months agoHandle subnormals of x86 80-bit
Jarkko Hietaniemi [Mon, 15 Aug 2016 02:52:40 +0000 (22:52 -0400)] 
Handle subnormals of x86 80-bit

(cherry picked from commit f40ac91c3b9891b83f3d253861009c290584b646)

23 months agoUse library testing for subnormality
Jarkko Hietaniemi [Sun, 14 Aug 2016 23:59:32 +0000 (19:59 -0400)] 
Use library testing for subnormality

...instead of implementing it brokenly

Continuing work on rt.perl.org #128843

(cherry picked from commit f5a466613ec0b74a224adb5b7da6da0a74713596)

23 months agoFollow-up on a149d118.
Jarkko Hietaniemi [Sun, 14 Aug 2016 14:16:55 +0000 (10:16 -0400)] 
Follow-up on a149d118.

The added tests were meant only for x86-80-bit long doubles,
but were accidentally run also on 128-bit doubles (quadmath,
or probably also on true IEEE 754 quadruples).

(cherry picked from commit 7301378635b35757b228e07c14276afaf06a4728)

23 months ago[perl #128919] limited exponent range in hex fp literal with long double
Jarkko Hietaniemi [Sat, 13 Aug 2016 23:13:58 +0000 (19:13 -0400)] 
[perl #128919] limited exponent range in hex fp literal with long double

(cherry picked from commit a149d1180209525972d84fd1a62f488da83e568a)

23 months agoAvoid test noise on non-longdouble.
Jarkko Hietaniemi [Fri, 12 Aug 2016 23:08:56 +0000 (19:08 -0400)] 
Avoid test noise on non-longdouble.

(cherry picked from commit 9e67a8c1b21482ed5fada053dd462eb23320dc86)

23 months ago[rt.perl.org #128909] printf %a mishandles exponent-crossing rounding with long double
Jarkko Hietaniemi [Fri, 12 Aug 2016 21:36:58 +0000 (17:36 -0400)] 
[rt.perl.org #128909] printf %a mishandles exponent-crossing rounding with long double

(cherry picked from commit ee58923a8531731f8acb98ab130abf41f75ebdc7)

23 months agoBogus skip count.
Jarkko Hietaniemi [Fri, 12 Aug 2016 21:30:25 +0000 (17:30 -0400)] 
Bogus skip count.

Didn't break anything but still bogus.

(cherry picked from commit 44348173fce5aaf28fdf59ba6ace73ea435d9380)

23 months agoTest new hexfp fixes also on (x86 80-bit) long doubles.
Jarkko Hietaniemi [Fri, 12 Aug 2016 12:12:41 +0000 (08:12 -0400)] 
Test new hexfp fixes also on (x86 80-bit) long doubles.

(cherry picked from commit e3f7a67e8485950fdf5fd9c7131d0a78b6c8cf32)

23 months agoFix on top of 75326c48.
Jarkko Hietaniemi [Thu, 11 Aug 2016 23:53:30 +0000 (19:53 -0400)] 
Fix on top of 75326c48.

Worked partly accidentally, and as a bonus caused asan
off-stack-variable read violations.

(cherry picked from commit 5208a0305e9e82c534fa034515d54a0409dfcc77)

23 months agoThe new tests are valid only for IEEE 754 64-bit doubles.
Jarkko Hietaniemi [Thu, 11 Aug 2016 22:19:00 +0000 (18:19 -0400)] 
The new tests are valid only for IEEE 754 64-bit doubles.

The tests do not fail (I wish), they would just need to be different
for example for the 80-bt x86 long doubles, for example, which scale
differently:

    perl -wle 'printf "%a\n", -1.5'  # IEEE 754 64-bit
    -0x1.8+0
    perl -wle 'printf "%a\n", -1.5'  # x86 80-bit
    -0xcp-3

In any system:

    perl -wle 'print -0x1.8p+0'
    -1.5
    perl -wle 'print -0xcp-3'
    -1.5

See earlier in this file a long if-elsif chain when testing
the @hexfloat because of this very same reason.

(cherry picked from commit 749d85343f3cdb65891a5fe3b9f55ef3a5b03ca8)

23 months ago[rt.perl.org #128893]: printf %a botches 0 flag for negative values
Jarkko Hietaniemi [Thu, 11 Aug 2016 13:18:27 +0000 (09:18 -0400)] 
[rt.perl.org #128893]: printf %a botches 0 flag for negative values

(cherry picked from commit be93048a43d87d317acca5b37619111b6a5f8c44)

23 months ago[rt.perl.org #128890]: printf %a rounds incorrectly
Jarkko Hietaniemi [Thu, 11 Aug 2016 13:15:21 +0000 (09:15 -0400)] 
[rt.perl.org #128890]: printf %a rounds incorrectly

(cherry picked from commit 75326c485e9d40be5c22d508f581cdea68b244ce)

23 months ago[rt.perl.org #128889]: printf %a mishandles negative pseudo-precision
Jarkko Hietaniemi [Thu, 11 Aug 2016 13:12:04 +0000 (09:12 -0400)] 
[rt.perl.org #128889]: printf %a mishandles negative pseudo-precision

(the fix for [rt.perl.org #128888] fixed also this one)

(cherry picked from commit a9ce335538454d590920dab8d62db84948f1fb83)

23 months ago[rt.perl.org #128888]: printf %a mishandles zero precision
Jarkko Hietaniemi [Wed, 10 Aug 2016 23:06:03 +0000 (19:06 -0400)] 
[rt.perl.org #128888]: printf %a mishandles zero precision

(cherry picked from commit 82229f9f47d9a169b59715582fb5a09b5a4ac0ff)

23 months agoComment fix for b6d9b423
Jarkko Hietaniemi [Wed, 10 Aug 2016 23:47:19 +0000 (19:47 -0400)] 
Comment fix for b6d9b423

(cherry picked from commit 520f3e58c346a7bc3ef0509dfe0db206dae454ee)

23 months agoAdd rt.perl.org reference for b6d9b423
Jarkko Hietaniemi [Wed, 10 Aug 2016 23:13:36 +0000 (19:13 -0400)] 
Add rt.perl.org reference for b6d9b423

(cherry picked from commit 94d00769fba240ffb86f18b3d66341fb1d24ae6c)

23 months agohexfp: IEEE 754 subnormals printf %a
Jarkko Hietaniemi [Wed, 9 Aug 2017 12:19:16 +0000 (13:19 +0100)] 
hexfp: IEEE 754 subnormals printf %a

(cherry picked from commit b6d9b423fab1963346eb79e83b356114396b1f2e)

23 months agotoke.c: fix mswin32 builds
David Mitchell [Mon, 5 Sep 2016 14:49:28 +0000 (15:49 +0100)] 
toke.c: fix mswin32 builds

9bde56224 added this as part of macro:

- PL_last_lop_op = f; \
+ PL_last_lop_op = f < 0 ? -f : f; \

which broke win32 builds due to this

    UNIBRACK(-OP_ENTEREVAL)

expanding to

    PL_last_lop_op = -345 < 0 ? --345 : -345

and the -- being seen as a pre-dec op.

Diagnosed by Dagfinn Ilmari Mannsåker.

(cherry picked from commit 0af40c757f083cc12988effb46da5313cd042f00)

23 months agoTreat VSI C the same as DEC/Compaq/HP C.
Craig A. Berry [Wed, 2 Nov 2016 00:06:06 +0000 (19:06 -0500)] 
Treat VSI C the same as DEC/Compaq/HP C.

(cherry picked from commit f6a154ae766a3404d83b81448ca6a356d30198e1)

23 months agosilence MSVC warnings for NATIVE_UTF8_TO_I8/I8_TO_NATIVE_UTF8
Daniel Dragan [Sun, 14 Aug 2016 15:01:00 +0000 (11:01 -0400)] 
silence MSVC warnings for NATIVE_UTF8_TO_I8/I8_TO_NATIVE_UTF8

The result of I8_TO_NATIVE_UTF8 has to be U8 casted for the MSVC specific
PERL_SMALL_MACRO_BUFFER option just like it is for newer CCs that dont
have a small CPP buffer. Commit 1a3756de64/#127426 did add U8 casts to
NATIVE_TO_LATIN1/LATIN1_TO_NATIVE but missed
NATIVE_UTF8_TO_I8/I8_TO_NATIVE_UTF8. This commit fixes that.

One example of the C4244 warning is VC6 thinks 0xFF & (0xFE << 6) in
UTF_START_MARK could be bigger than 0xff (a char), fixes
..\inline.h(247) : warning C4244: '=' : conversion from 'long ' to
'unsigned char ', possible loss of data

Also fixes
..\utf8.c(146) : warning C4244: '=' : conversion from 'UV' to 'U8',
possible loss of data
and alot more warnings in utf8.c

(cherry picked from commit 1d4ea287e9a924ad1eaef98145b6d6c3b6219e80)

23 months agoFix -Dr output regression
Karl Williamson [Wed, 6 Jul 2016 17:52:01 +0000 (11:52 -0600)] 
Fix -Dr output regression

Several commits in the 5.23 series improved the display of the compiled
ANYOF regnodes, but introduced two bugs.  One of them is in \p{Any} and
similar things that match the entire range 0-255.  That range is omitted,
so it looks like \p{Any} only matches code points above 255.  Note that
this is only what gets displayed under -Dr.  What actually gets compiled
has been and still is fine.

The other is that when displaying a pattern that still has unresolved
user-defined properties that are complemented, it doesn't show properly
that the whole thing is complemented.  That is, the output looks like it
doesn't obey De Morgan's laws.

The fixes to these are quite intertwined, and so I didn't try to
separate them.

(cherry picked from commit 753b2c6a60a81dacbe59e2041e30e8302484dc2d)

23 months ago[perl #129196] Crash/bad read with ‘evalbytes S’
Father Chrysostomos [Mon, 5 Sep 2016 03:24:19 +0000 (20:24 -0700)] 
[perl #129196] Crash/bad read with ‘evalbytes S’

5dc13276 added some code to toke.c that did not take into account
that the opnum (‘f’) argument to UNI* could be a negated op number.
PL_last_lop_op must never be negative, since it is used as an offset
into a struct.

Tests for the crash will come in the next commit.

(cherry picked from commit 9bde56224e82f20e7a65b3469b1ffb6b9f6d4df8)

23 months ago[perl #128951] Fix ASan error with @{\327
Father Chrysostomos [Wed, 9 Aug 2017 07:08:53 +0000 (08:08 +0100)] 
[perl #128951] Fix ASan error with @{\327

By \327 I mean character number 327 in octal.

Without memory tools like ASan, it produces garbled output.  The added
test fails like this:

Dave Mitchell’s explanation from the RT ticket:
> The src code contains the bytes:
>
>     @ { \327 \n
>
> after seeing "@{" the lexer calls scan_ident(), which sees the \327 as an
> ident, then calls S_skipspace_flags() to skip the spaces following the
> ident.  This moves the current cursor position to the \n, and since that's
> a line boundary, its updates PL_linestart and PL_bufptr to point to \n
> too.
>
> When it finds that the next char isn't a '}', it does this:
>
>             /* Didn't find the closing } at the point we expected, so restore
>                state such that the next thing to process is the opening { and */
>      s = SvPVX(PL_linestr) + bracket; /* let the parser handle it */
>
> i.e. it moves s back to the "{\317" then continues.
>
> However, PL_linestart doesn't get reset, so later when the parser
> encounters the \327 and tries to croak with "Unrecognized character %s ...",
> when it prints out the section of src code in error, since s < PL_linestr,
> negative string lengths and ASAN errors ensue.

This commit fixes it by passing the LEX_NO_INCLINE flag (added by
21791330a), which specifies that we are not trying to read past the
newline but simply peek ahead.  In that case lex_read_space does not
reset PL_linestart.

But that does cause problems with code like:

${;

}

because we end up jumping ahead via skipspace without updating the
line number.  So we need to do a skipspace_flags(..., LEX_NO_INCLINE)
first (i.e., peek ahead), and then when we know we don’t need to go
back again we can skipspace(...) for real.

(cherry picked from commit bf8a9a15ea4a7b7ebcde5ba48aafe397c549eff2)

23 months agoVersion bump for previous cherry-pick
Steve Hay [Wed, 9 Aug 2017 07:07:42 +0000 (08:07 +0100)] 
Version bump for previous cherry-pick

23 months ago[perl #128763] Fix POSIX.xs longdbl assertion
Jarkko Hietaniemi [Thu, 28 Jul 2016 16:55:07 +0000 (09:55 -0700)] 
[perl #128763] Fix POSIX.xs longdbl assertion

(cherry picked from commit d80a6052a64d2df61ee61888853ef5f3872c0e34)

23 months ago[perl #128597] Crash from gp_free/ckWARN_d
Father Chrysostomos [Mon, 11 Jul 2016 21:49:17 +0000 (14:49 -0700)] 
[perl #128597] Crash from gp_free/ckWARN_d

See the explanation in the test added and in the RT ticket.

The solution is to make the warn macros check that PL_curcop
is non-null.

(cherry picked from commit a2637ca0a3fec01b80d7ea5ba62802354fd5e6f3)

23 months agoAnother op description correction: & -> &.
Father Chrysostomos [Sat, 21 May 2016 03:32:48 +0000 (20:32 -0700)] 
Another op description correction: & -> &.

The string bitwise ops have dots in them, which should be included
in the op descriptions.

(cherry picked from commit 118a40c4aa59af9330f4c37e86423a8b7c0d301c)

23 months agoCorrect ‘bitiwse’ in two op descriptions
Father Chrysostomos [Sat, 21 May 2016 03:24:50 +0000 (20:24 -0700)] 
Correct ‘bitiwse’ in two op descriptions

Oops!

(cherry picked from commit 5cb51e4d385f1a78e57460db8c624392985b7678)

23 months agoPATCH: [perl #128219] typo in perlrecharclass
Karl Williamson [Mon, 23 May 2016 14:04:53 +0000 (08:04 -0600)] 
PATCH: [perl #128219] typo in perlrecharclass

Thanks for spotting this.  It was a typo.  Alpha matches XPosixAlpha.

(cherry picked from commit 4cb26c52ed90189e6e3564a4654b869fe4c4d3e6)

23 months ago[perl #128204] Fix crash with @a &.= etc.
Father Chrysostomos [Sat, 21 May 2016 04:55:40 +0000 (21:55 -0700)] 
[perl #128204] Fix crash with @a &.= etc.

The new bitwise operators in their assignment forms were not correctly
catching things like arrays on the lhs at compile time.

At run time, they would either crash or croak with ‘Can’t coerce
ARRAY...’.

This commit puts in the correct compile-time check, simply by flagging
these as scalar modifiers.

(cherry picked from commit 76734a3218e712760695898e424c2369ccdd49c6)

23 months ago[perl #128171] Fix assert fail with /@0{0*->@*/*0
Father Chrysostomos [Wed, 18 May 2016 01:16:52 +0000 (18:16 -0700)] 
[perl #128171] Fix assert fail with /@0{0*->@*/*0

If a syntax error such as * (multiply) followed by an arrow causes the
parser to pop scopes in trying to recover from the error, it might
exit the quote-parsing scope (for parsing the regexp) and point the
lexer’s cursor at the code following the regexp, after the lexer has
noted to itself that it is expected to parse a postfix dereference
(PL_expect==XPOSTDEREF).

The code for parsing a postfix dereference has an assertion which
ends up failing in this case, because the *0 following the regexp,
having sigil that can come after an arrow, goes through the postfix
deref function, which complains about the 0 it did not expect.

If we simply remove the assertion, the lexer will continue to emit
tokens, and we just end up dying (somewhat) gracefully because of the
syntax error, instead of crashing.

I used a ] in the test instead of a final 0, to avoid a compile-
time warning.  (Number found where operator expected.)

(cherry picked from commit d674449463a15ac3f36086e3a0bb3a9d02729887)

23 months agofix symbol detection with gcc 6 link-time optimization (RT #128131)
Lukas Mai [Wed, 11 May 2016 20:15:34 +0000 (22:15 +0200)] 
fix symbol detection with gcc 6 link-time optimization (RT #128131)

(cherry picked from commit adec5bbf0b66ee5ebc2ba80eda2389bb68e23d86)

23 months ago[perl #128106] Fix reset with non-globs
Father Chrysostomos [Tue, 10 May 2016 21:14:40 +0000 (14:14 -0700)] 
[perl #128106] Fix reset with non-globs

reset with a string argument was assuming that anything in a
stash would be a glob.  It crashed on anything else.

(cherry picked from commit fcd130693a9e7a753f63a08691ff619ad91bf8eb)

23 months ago[perl #128086] Test the prev commit
Father Chrysostomos [Sun, 15 May 2016 20:49:33 +0000 (13:49 -0700)] 
[perl #128086] Test the prev commit

(cherry picked from commit 7f1bd063e5aa5aeb26ed9c39db6864cc0ecd7a73)

23 months ago[perl #128086] Fix precedence in hv_ename_delete
Hugo van der Sanden [Sun, 15 May 2016 20:48:58 +0000 (13:48 -0700)] 
[perl #128086] Fix precedence in hv_ename_delete

A stash’s array of names may have null for the first entry, in which
case it is not one of the effective names, and the name count will
be negative.

The ‘count > 0’ is meant to prevent hv_ename_delete from trying to
read that entry, but a precedence problem introduced in 4643eb699
stopped it from doing that.

[This commit message was written by the committer.]

(cherry picked from commit 60a26c797bbff039ea7f861903732e7cceae415a)

23 months ago[perl #127952] misoptimization for negated constant-ish on lhs of logop
Aaron Crane [Sun, 15 May 2016 14:11:12 +0000 (15:11 +0100)] 
[perl #127952] misoptimization for negated constant-ish on lhs of logop

Negations were being incorrectly deleted from the op tree for an OP_AND or
OP_OR (corresponding to Perl code with any of `&& || and or`, or postfix
"if" or "unless") whose left-hand side looks like "!BAREWORD" or "!do {
'const' }" and whose right-hand side is a non-constant-foldable negation.

The symptom in the reported case was an assertion failure in ck_refassign
for an srefgen op, caused by such an OP_NOT having been nulled. But other
cases exist that instead yielded incorrect results.

The underlying cause is that two optimisations in S_new_logop() were
partially interfering with each other. One of those attempts to optimise
code like "!$x && !$y" to the equivalent of "!($x || $y)", saving a
negation op; this is valid by De Morgan's laws. If it detects code of
this form, it nulls out the negations on each side of the "&&", and makes
a note to wrap the op it generates inside a new OP_NOT.

The other optimisation looks at the left-hand arm, and if it's a constant at
compile time, avoids the entire logop in favour of directly evaluating the
lhs or rhs as appropriate, and eliding whichever arm is no longer needed.
This optimisation is important for code like this:

    use constant DEBUG => …;
    print_debug_output() if DEBUG;

because it allows the entire statement to be eliminated when DEBUG is false.

When both conditions were true simultaneously, the De Morgan optimisation
was applied before the constant-based arm elision. But the arm elision
involved returning early from S_new_logop(), so the code later in that
function that wraps the generated op in a new OP_NOT never had a chance to
run. This meant that "!X && !Y" when X is constant was being compiled as if
it were in fact "X || Y", which is clearly incorrect.

This is, however, a very rare situation: it requires the lhs to be an OP_NOT
that dominates an OP_CONST (possibly with some intervening OP_LINESEQ or
similar). But OP_NOT is constant-foldable, so that doesn't normally happen.
The two ways for it to happen are:

- The constant is a bareword (since even though barewords are constants,
  they don't currently participate in constant folding)

- The constant is hidden inside one or more layers of do{} (since that
  serves as a barrier to constant folding, but the arm-elision optimisation
  is smart enough to search recursively through the optree for the real
  constant)

The fix is much simpler than the explanation: apply the optimisations in the
opposite order, so that when arm elision returns early, the negation ops
haven't yet been nulled.

(cherry picked from commit f15d05806fb7522031b75cb5a8784727ae03b98a)

23 months agoUpgrade Time::HiRes from version 1.9733 to 1.9741
Steve Hay [Tue, 8 Aug 2017 12:26:27 +0000 (13:26 +0100)] 
Upgrade Time::HiRes from version 1.9733 to 1.9741

Fixes perl #128427, #128445 and #128972, and cpan #120032. We don't
normally do module upgrades for maint releases, but this seems like the
simplest and safest approach on this occasion.

23 months agoavoid a leak in list assign from/to magic values
David Mitchell [Wed, 15 Feb 2017 15:58:24 +0000 (15:58 +0000)] 
avoid a leak in list assign from/to magic values

RT #130766

A leak in list assignment was introduced by v5.23.6-89-gbeb08a1 and
extended with v5.23.6-90-g5c1db56.

Basically the code in S_aassign_copy_common() which does a mark-and-sweep
looking for common vars by temporarily setting SVf_BREAK on LHS SVs then
seeing if that flag was present on RHS vars, very temporarily removed that
flag from the RHS SV while mortal copying it, then set it again. After
those two commits, the "resetting" code could set SVf_BREAK on the RHS SV
even when it hadn't been been present earlier.

This meant that on exit from S_aassign_copy_common(), some SVs could be
left with SVf_BREAK on. When that SV was freed, the SVf_BREAK flag meant
that the SV head wasn't planted back in the arena (but PL_sv_count was
still decremented). This could lead to slow growth of the SV HEAD arenas.

The two circumstances that could trigger the leak were:

1) An SMG var on the LHS and a temporary on the RHS, e.g.

    use Tie::Scalar;
    my ($s, $t);
    tie $s, 'Tie::StdScalar'; # $s has set magic
    while (1) {
        ($s, $t) = ($t, map 1, 1, 2); # the map returns temporaries
    }

2) A temporary on the RHS which has GMG, e.g.

    my $s = "abc";
    pos($s) = 1;
    local our ($x, $y);
    while (1) {
        my $pr = \pos($s); # creates a ref to a TEMP with get magic
        ($x, $y) = (1, $$pr);
    }

Strictly speaking a TEMP isn't required for either case; just a situation
where there's always a fresh SV on the RHS for each iteration that will
soon get freed and thus leaked.

This commit doesn't include any tests since I can't think of a way of
testing it. svleak.t relies on PL_sv_count, which in this case doesn't
show the leak.

(cherry picked from commit 1050723fecc0e27677c39fadbb97cb892dfd27d2)

23 months agoFix typo in perlrun.pod
Steven Humphrey [Tue, 20 Sep 2016 11:42:39 +0000 (12:42 +0100)] 
Fix typo in perlrun.pod

s/and/any/
perl -c documentation has a typo when talking about BEGIN blocks.

Steven Humphrey is now a Perl author.

For: RT #129313
(cherry picked from commit 2c4188f3fe3f46d4ebe3f23a094a7cf96ebe87f1)

23 months agoCorrect 'map' documentation to reflect operation on a list.
Dave Cross [Thu, 1 Sep 2016 22:29:58 +0000 (18:29 -0400)] 
Correct 'map' documentation to reflect operation on a list.

Rather than on an array.

For: RT #126169.

Dave Cross is now a Perl Author.

(cherry picked from commit 7c280bee056f2462f4b4aa2150a160fb9176601e)

23 months agoProvide missing link for one instance of 'eval'.
James E Keenan [Thu, 1 Sep 2016 18:39:16 +0000 (14:39 -0400)] 
Provide missing link for one instance of 'eval'.

As originally reported by KES.  See RT #129168.

(cherry picked from commit 177f0db9b219c09ca9541c325f9309b8cca12ac4)