In perl.git, the branch maint-5.20 has been updated <http://perl5.git.perl.org/perl.git/commitdiff/69aabb7819a9fba427cb752aa7b59cc53ef51cd8?hp=c31cda5e7d3712210cd9b0aa0b5395fcebdd47e8>
- Log ----------------------------------------------------------------- commit 69aabb7819a9fba427cb752aa7b59cc53ef51cd8 Author: kmx <[email protected]> Date: Tue Dec 16 08:52:07 2014 +0000 [perl #123438] Wrong comment style in win32/win32.h (cherry picked from commit 08088357011bedc22047b1d4a1ec3afaee813523) M win32/win32.h commit 347527b7398df7ae2660f4e26e8b7a716ef77b09 Author: Tony Cook <[email protected]> Date: Wed Oct 29 13:53:13 2014 +1100 [perl #120487] make sure we're using an unmodified @INC to load Win32 rmtree() indirectly loads Win32, and since the test adds $Config{installsitelib) to @INC, if a previous perl has been installed in the current build's installation directory, the wrong module may be loaded. This is made worse by Win32 perl not using the archname in the library directory. (cherry picked from commit 3415f8b9fb121a138ed954f9ced0b2c1f4660e48) M dist/lib/t/01lib.t commit 3d894d5dfa8e6a0660be78ab92a8027fbb858236 Author: Daniel Dragan <[email protected]> Date: Tue Oct 21 14:44:37 2014 -0400 make -DNO_MATHOMS work on Win32 If you try to export symbols which dont exist, VC linker fails. NO_MATHOMS now works on Win32. The list of symbols is from VC's error log. (cherry picked from commit dceaccf89041ac723759e83a3a31bedc8d82a38d) M makedef.pl commit 0f861863a5efe11e6353b028b2d12ac38272ba6d Author: Daniel Dragan <[email protected]> Date: Thu Oct 9 19:43:13 2014 -0400 fix WinCE build locale changes in 2014 broke WinCE build. localconv() doesn't exist on WinCE. locale.h from celib has to be included for setlocale()/xcesetlocale() and LC_* constants. (cherry picked from commit c7925a5e8559739ce765137cf6164c5872c63a96) M perl.h M win32/config.ce M win32/config_H.ce commit c6d0992285ada880ccb6bd55d9fca8481298e5b7 Author: Ãvar Arnfjörð Bjarmason <[email protected]> Date: Tue Oct 7 19:57:59 2014 +0000 t/io/eintr.t: Make this pass on my ppc64 box See the "Test failures in blead on ppc64" thread on perl5-porters for details. I'd fail on the previous value, this passes every time. (cherry picked from commit 1e02895ff34c407637067df12a1b06eb07a5a96a) M t/io/eintr.t commit d4bf004f2287cb227021e60cfd781e2ec3286710 Author: Steve Hay <[email protected]> Date: Mon Jan 12 08:48:26 2015 +0000 Bump $Errno::VERSION for previous commits (cherry picked from commit 5884c88b2d4d412c81919fffcc0c487b49521793) [Edited by the committer to bump the $VERSION to a value that has not already been used and will not be used in the future: blead bumped the $VERSION to 1.21, but maint-5.20's copy of the file is different so should not use the same $VERSION number.] M ext/Errno/Errno_pm.PL commit 9f8fea7e4a972f1ecfd12fb15a01ba550ef26165 Author: Steve Hay <[email protected]> Date: Wed Sep 24 09:13:26 2014 +0100 Errno parsing: Skip expressions containing function names etc Expressions containing a function name are no more eval()able than expressions which are just a function name, so skip them too. This also picks up on text in the expression and stops eval()s from whining about "String found where operator expected" on Win32 (with VC10) on expressions like L"\\Enlistment\\" and (sizeof(L"\\Enlistment\\")+(38*sizeof(WCHAR))), encountered when parsing ENLISTMENT_OBJECT_PATH and ENLISTMENT_OBJECT_NAME_LENGTH_IN_BYTES respectively. (cherry picked from commit cc192ed19bd1c52dd1711a900ce276043ce418ae) M ext/Errno/Errno_pm.PL commit 8a6efa530aa4d686692a5fb2ea1005c2f256481c Author: Steve Hay <[email protected]> Date: Wed Sep 24 08:53:39 2014 +0100 Errno parsing: Don't match hex numbers in parts of function names This stops __stdcall being seen as a hex number and turned into __stdca. Also include _ in the pattern to match function names so that that gets skipped anyway. (cherry picked from commit 2d4a3ccef465111dae0e5e71cf008e97efeb057c) M ext/Errno/Errno_pm.PL commit 81db2a3ca4f81be556f3fcf316d5be35bf38e8af Author: Steve Hay <[email protected]> Date: Wed Sep 24 08:25:24 2014 +0100 Tweak Errno parsing some more This requires there to be something present in the "0xcafebabe" part of the "((type)0xcafebabe)" (et alia) pattern, otherwise it can end up matching things that it shouldn't. (The "type" part is already required to be non-empty.) (cherry picked from commit 1ef3f55063eff0bda07fa2251ec16a7807dfb602) M ext/Errno/Errno_pm.PL commit 4275f80a0f66cd79f20447bc44c4ddfc923fc9ac Author: Steve Hay <[email protected]> Date: Tue Sep 23 13:51:32 2014 +0100 Improve Errno parsing of Win32 output This allows us to pluck "0xC038000FL" rather than "(0xC038000FL" out of "(DWORD)(0xC038000FL)", which means we go into the hex case rather than the eval case, and get the desired result (hex '0xC038000F' returns 3224895503, whereas eval '(0xC038000F' returns nothing). Also allows for "((DWORD)(0xC038000FL))" and other existing formats. (cherry picked from commit a3baa5664f4da7f412812e0188d5ac3bab0b8694) M ext/Errno/Errno_pm.PL commit f7520732f2e5c342f1929e9fbf0a62963b84ce25 Author: Karl Williamson <[email protected]> Date: Sat Aug 23 17:50:11 2014 -0600 sv.c: Silence VMS compiler warning The result of this must be at least 0 as the type is unsigned, so the compiler gives a warning. (cherry picked from commit 5b26a7b38f5eacab94ffc56c123c01ad6c3788dc) M sv.c commit 98f54315167f5701a0cbf64ccc2581a764cc549d Author: Jarkko Hietaniemi <[email protected]> Date: Sun Sep 14 13:28:00 2014 -0400 Darwin: set ld to 'cc' if $cc is 'cc' or empty, $cc otherwise. (cherry picked from commit 990a70b8c9866c888194f4c2c6d152d7911b3c34) M hints/darwin.sh commit 2e3cc4444309946da3253dace5de136d4c103422 Author: Jarkko Hietaniemi <[email protected]> Date: Sat Sep 13 22:06:13 2014 -0400 Darwin: if cc is explicitly gcc/g++, use it also as ld. (cherry picked from commit 44b62df7ceb322e1e0484f45065025f0a709303c) M hints/darwin.sh commit 4a7b79bdec0c7bcbe7c14c204ce8906818554749 Author: Father Chrysostomos <[email protected]> Date: Mon Jan 12 08:46:41 2015 +0000 parser.t: Correct skip count I increased the skip count in 08b999a9 by mistake. For crashing bugs, executing the code that would have crashed is sufficient to test it. (cherry picked from commit ca949e9c3c10048fd3c2829b96293e6139846dcc) M t/comp/parser.t commit 23bf753e34f09274ed8aa862a14ca96e4d4794b4 Author: Father Chrysostomos <[email protected]> Date: Mon Jan 12 08:45:57 2015 +0000 [perl #123452] Fix crash with s/${<>{})// s/foo/bar/ tokenizes as something akin to subst("foo","bar") and the resulting list op representing the contents of the parentheses is passed to pmruntime as its expr argument. If we have invalid code like s/${<>{})//, the bison parser will dis- card invalid tokens until it finds something it can fall back to, in an attempt to keep parsing (to report as many errors as possible). In the process of discarding tokens, it may convert s/${<>{})//, which the lexer emits like this: PMFUNC ( $ { THING(readline) { } ) , "" ) into this: PMFUNC ( $ { THING(readline) } ) , "" ) (or something similar). So when the parser sees the first closing parentheses, it decides it has a complete PMFUNC(...), and the expr argument to pmruntime ends up being an rv2sv op (the ${...}), not a list op. pmruntime assumes it is a list op, and tries to access its op_last field, to find the replacement part; but rv2sv has no op_last field, so this reads past the end of the op struct, usually into the first pointer in the next op slot, which itself is an opslot pointer, not an op pointer, so things really screw up. If we check that the arguments to subst are indeed a list op first before trying to extract the replacement part, everything works. We get the syntax errors reported as expected, but no crash. (cherry picked from commit 08b999a9d7e845b758c38568f45f6b2b8d552ed9) M op.c M t/comp/parser.t ----------------------------------------------------------------------- Summary of changes: dist/lib/t/01lib.t | 3 + ext/Errno/Errno_pm.PL | 8 +-- hints/darwin.sh | 9 ++- makedef.pl | 152 ++++++++++++++++++++++++++++++++++++++++++++++++++ op.c | 5 +- perl.h | 9 +++ sv.c | 2 +- t/comp/parser.t | 3 + t/io/eintr.t | 9 ++- win32/config.ce | 4 +- win32/config_H.ce | 2 +- win32/win32.h | 4 +- 12 files changed, 196 insertions(+), 14 deletions(-) diff --git a/dist/lib/t/01lib.t b/dist/lib/t/01lib.t index f58fce5..366ab47 100644 --- a/dist/lib/t/01lib.t +++ b/dist/lib/t/01lib.t @@ -38,6 +38,9 @@ MODULE } END { + # rmtree() can indirectly load the XS object for Win32, ensure + # we have our original sane @INC + local @INC = @OrigINC; # cleanup the auto/ directory we created. rmtree([$lib_dir[0]]); } diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL index 55ad01a..cfab893 100644 --- a/ext/Errno/Errno_pm.PL +++ b/ext/Errno/Errno_pm.PL @@ -2,7 +2,7 @@ use ExtUtils::MakeMaker; use Config; use strict; -our $VERSION = "1.20_03"; +our $VERSION = "1.20_05"; my %err = (); @@ -249,9 +249,9 @@ sub write_errno_pm { my($name,$expr); next unless ($name, $expr) = /"(.*?)"\s*\[\s*\[\s*(.*?)\s*\]\s*\]/; next if $name eq $expr; - $expr =~ s/\(?\(\s*[a-z_]\w*\s*\)([^\)]*)\)?/$1/i; # ((type)0xcafebabe) at alia - $expr =~ s/((?:0x)?[0-9a-fA-F]+)[luLU]+\b/$1/g; # 2147483647L et alia - next if $expr =~ m/^[a-zA-Z]+$/; # skip some Win32 functions + $expr =~ s/\(?\(\s*[a-z_]\w*\s*\)\(?([^\)]+)\)?\)?/$1/i; # ((type)0xcafebabe) at alia + $expr =~ s/\b((?:0x)?[0-9a-f]+)[LU]+\b/$1/gi; # 2147483647L et alia + next if $expr =~ m/\b[a-z_]\w*\b/i; # skip expressions containing function names etc if($expr =~ m/^0[xX]/) { $err{$name} = hex $expr; } diff --git a/hints/darwin.sh b/hints/darwin.sh index 7c3f818..276695a 100644 --- a/hints/darwin.sh +++ b/hints/darwin.sh @@ -168,7 +168,14 @@ esac # Allow the user to override ld, but modify it as necessary below case "$ld" in - '') ld='cc';; + '') case "$cc" in + # If the cc is explicitly something else than cc (or empty), + # set the ld to be that explicitly something else. Conversely, + # if the cc is 'cc' (or empty), set the ld to be 'cc'. + cc|'') ld='cc';; + *) ld="$cc" ;; + esac + ;; esac # Perl bundles do not expect two-level namespace, added in Darwin 1.4. diff --git a/makedef.pl b/makedef.pl index 8b972a4..a44c014 100644 --- a/makedef.pl +++ b/makedef.pl @@ -420,6 +420,158 @@ unless ($define{'PERL_IMPLICIT_CONTEXT'}) { Perl_my_cxt_index ); } +if ($define{'NO_MATHOMS'}) { + ++$skip{$_} foreach qw( + ASCII_TO_NEED + NATIVE_TO_NEED + Perl_custom_op_desc + Perl_custom_op_name + Perl_do_aexec + Perl_do_binmode + Perl_do_open + Perl_do_open9 + Perl_fprintf_nocontext + Perl_gv_AVadd + Perl_gv_HVadd + Perl_gv_IOadd + Perl_gv_SVadd + Perl_gv_efullname + Perl_gv_efullname3 + Perl_gv_fetchmethod + Perl_gv_fullname + Perl_gv_fullname3 + Perl_hv_delete + Perl_hv_delete_ent + Perl_hv_exists + Perl_hv_exists_ent + Perl_hv_fetch + Perl_hv_fetch_ent + Perl_hv_iternext + Perl_hv_magic + Perl_hv_store + Perl_hv_store_ent + Perl_hv_store_flags + Perl_init_i18nl14n + Perl_isALNUM_lazy + Perl_isIDFIRST_lazy + Perl_is_uni_alnum + Perl_is_uni_alnum_lc + Perl_is_uni_alnumc + Perl_is_uni_alnumc_lc + Perl_is_uni_alpha + Perl_is_uni_alpha_lc + Perl_is_uni_ascii + Perl_is_uni_ascii_lc + Perl_is_uni_blank + Perl_is_uni_blank_lc + Perl_is_uni_cntrl + Perl_is_uni_cntrl_lc + Perl_is_uni_digit + Perl_is_uni_digit_lc + Perl_is_uni_graph + Perl_is_uni_graph_lc + Perl_is_uni_idfirst + Perl_is_uni_idfirst_lc + Perl_is_uni_lower + Perl_is_uni_lower_lc + Perl_is_uni_print + Perl_is_uni_print_lc + Perl_is_uni_punct + Perl_is_uni_punct_lc + Perl_is_uni_space + Perl_is_uni_space_lc + Perl_is_uni_upper + Perl_is_uni_upper_lc + Perl_is_uni_xdigit + Perl_is_uni_xdigit_lc + Perl_is_utf8_alnum + Perl_is_utf8_alnumc + Perl_is_utf8_alpha + Perl_is_utf8_ascii + Perl_is_utf8_blank + Perl_is_utf8_char + Perl_is_utf8_cntrl + Perl_is_utf8_digit + Perl_is_utf8_graph + Perl_is_utf8_idcont + Perl_is_utf8_idfirst + Perl_is_utf8_lower + Perl_is_utf8_mark + Perl_is_utf8_perl_space + Perl_is_utf8_perl_word + Perl_is_utf8_posix_digit + Perl_is_utf8_print + Perl_is_utf8_punct + Perl_is_utf8_space + Perl_is_utf8_string_loc + Perl_is_utf8_upper + Perl_is_utf8_xdigit + Perl_is_utf8_xidcont + Perl_is_utf8_xidfirst + Perl_my_lstat + Perl_my_stat + Perl_newAV + Perl_newHV + Perl_newIO + Perl_newSUB + Perl_pack_cat + Perl_printf_nocontext + Perl_ref + Perl_save_freeop + Perl_save_freepv + Perl_save_freesv + Perl_save_iv + Perl_save_list + Perl_save_long + Perl_save_mortalizesv + Perl_save_nogv + Perl_save_op + Perl_save_re_context + Perl_sv_2iv + Perl_sv_2pv + Perl_sv_2pv_nolen + Perl_sv_2pvbyte_nolen + Perl_sv_2pvutf8_nolen + Perl_sv_2uv + Perl_sv_catpvn + Perl_sv_catpvn_mg + Perl_sv_catsv + Perl_sv_catsv_mg + Perl_sv_force_normal + Perl_sv_insert + Perl_sv_iv + Perl_sv_mortalcopy + Perl_sv_nolocking + Perl_sv_nounlocking + Perl_sv_nv + Perl_sv_pv + Perl_sv_pvbyte + Perl_sv_pvbyten + Perl_sv_pvn + Perl_sv_pvn_force + Perl_sv_pvn_nomg + Perl_sv_pvutf8 + Perl_sv_pvutf8n + Perl_sv_setsv + Perl_sv_taint + Perl_sv_unref + Perl_sv_usepvn + Perl_sv_usepvn_mg + Perl_sv_utf8_upgrade + Perl_sv_uv + Perl_to_uni_lower_lc + Perl_to_uni_title_lc + Perl_to_uni_upper_lc + Perl_to_utf8_fold + Perl_to_utf8_lower + Perl_to_utf8_title + Perl_to_utf8_upper + Perl_unpack_str + Perl_utf8_to_uvchr + Perl_utf8_to_uvuni + Perl_valid_utf8_to_uvuni + ); +} unless ($define{'PERL_NEED_APPCTX'}) { ++$skip{PL_appctx}; diff --git a/op.c b/op.c index cbab9ff..7337f23 100644 --- a/op.c +++ b/op.c @@ -4805,7 +4805,10 @@ Perl_pmruntime(pTHX_ OP *o, OP *expr, bool isreg, I32 floor) /* for s/// and tr///, last element in list is the replacement; pop it */ - if (is_trans || o->op_type == OP_SUBST) { + /* If we have a syntax error causing tokens to be popped and the parser + to see PMFUNC '(' expr ')' with no commas in it; e.g., s/${<>{})//, + then expr will not be of type OP_LIST, there being no repl. */ + if ((is_trans || o->op_type == OP_SUBST) && expr->op_type == OP_LIST) { OP* kid; repl = cLISTOPx(expr)->op_last; kid = cLISTOPx(expr)->op_first; diff --git a/perl.h b/perl.h index 147f203..1325de9 100644 --- a/perl.h +++ b/perl.h @@ -681,6 +681,15 @@ # endif #endif +/* EVC 4 SDK headers includes a bad definition of MB_CUR_MAX in stdlib.h + which is included from stdarg.h. Bad definition not present in SD 2008 + SDK headers. wince.h is not yet included, so we cant fix this from there + since by then MB_CUR_MAX will be defined from stdlib.h. + cewchar.h includes a correct definition of MB_CUR_MAX and it is copied here + since cewchar.h can't be included this early */ +#if defined(UNDER_CE) && (_MSC_VER < 1300) +# define MB_CUR_MAX 1 +#endif #ifdef I_STDARG # include <stdarg.h> #else diff --git a/sv.c b/sv.c index 6489468..88ec07c 100644 --- a/sv.c +++ b/sv.c @@ -3451,7 +3451,7 @@ must_be_utf8: * set so starts from there. Otherwise, can use memory copy to * get up to where we are now, and then start from here */ - if (invariant_head <= 0) { + if (invariant_head == 0) { d = dst; } else { Copy(s, dst, invariant_head, char); diff --git a/t/comp/parser.t b/t/comp/parser.t index 7caa116..3034129 100644 --- a/t/comp/parser.t +++ b/t/comp/parser.t @@ -499,6 +499,9 @@ eval 'for my a1b $i (1) {}'; # ng: 'Missing $ on loop variable' like $@, "^No such class a1b at ", 'TYPE of my of for statement'; +# Used to crash [perl #123452] +eval 's /${<>{}) //'; + # Add new tests HERE (above this line) # bug #74022: Loop on characters in \p{OtherIDContinue} diff --git a/t/io/eintr.t b/t/io/eintr.t index 9ea9cc7..32f109d 100644 --- a/t/io/eintr.t +++ b/t/io/eintr.t @@ -95,11 +95,16 @@ alarm(0); ok(!$st, 'read/die: read status'); ok(close($in), 'read/die: close status'); +# This used to be 1_000_000, but on Linux/ppc64 (POWER7) this kept +# consistently failing. At exactly 0x100000 it started passing +# again. We're hoping this number is bigger than any pipe buffer. +my $surely_this_arbitrary_number_is_fine = 0x100000; + # close during print fresh_io; $SIG{ALRM} = sub { $sigst = close($out) ? "ok" : "nok" }; -$buf = "a" x 1_000_000 . "\n"; # bigger than any pipe buffer hopefully +$buf = "a" x $surely_this_arbitrary_number_is_fine . "\n"; select $out; $| = 1; select STDOUT; alarm(1); $st = print $out $buf; @@ -112,7 +117,7 @@ ok(!close($out), 'print/close: close status'); fresh_io; $SIG{ALRM} = sub { die }; -$buf = "a" x 1_000_000 . "\n"; # bigger than any pipe buffer hopefully +$buf = "a" x $surely_this_arbitrary_number_is_fine . "\n"; select $out; $| = 1; select STDOUT; alarm(1); $st = eval { print $out $buf }; diff --git a/win32/config.ce b/win32/config.ce index 5177beb..bb87699 100644 --- a/win32/config.ce +++ b/win32/config.ce @@ -290,7 +290,7 @@ d_link='define' d_localtime64='undef' d_localtime_r='undef' d_localtime_r_needs_tzset='undef' -d_locconv='define' +d_locconv='undef' d_lockf='undef' d_longdbl='undef' d_longlong='undef' @@ -636,7 +636,7 @@ i_inttypes='undef' i_langinfo='undef' i_libutil='undef' i_limits='define' -i_locale='undef' +i_locale='define' i_machcthr='undef' i_malloc='define' i_mallocmalloc='undef' diff --git a/win32/config_H.ce b/win32/config_H.ce index e2837a6..196f419 100644 --- a/win32/config_H.ce +++ b/win32/config_H.ce @@ -227,7 +227,7 @@ * This symbol, if defined, indicates that the localeconv routine is * available for numeric and monetary formatting conventions. */ -#define HAS_LOCALECONV /**/ +/*#define HAS_LOCALECONV /**/ /* HAS_LOCKF: * This symbol, if defined, indicates that the lockf routine is diff --git a/win32/win32.h b/win32/win32.h index 46adb15..735c450 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -392,8 +392,8 @@ typedef char * caddr_t; /* In malloc.c (core address). */ #ifdef MYMALLOC #define EMBEDMYMALLOC /**/ -/* #define USE_PERL_SBRK /**/ -/* #define PERL_SBRK_VIA_MALLOC /**/ +/* #define USE_PERL_SBRK / **/ +/* #define PERL_SBRK_VIA_MALLOC / **/ #endif #ifdef PERL_TEXTMODE_SCRIPTS -- Perl5 Master Repository
