Avoid infinite loop in h2xs tool if enum and type have the same name

This commit is contained in:
Petr Písař 2016-11-03 14:49:51 +01:00
parent 281d2faaad
commit 62440eed42
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,32 @@
From 9ce5bf4c39e28441410672f39b5ee1c4569967f8 Mon Sep 17 00:00:00 2001
From: Hugo van der Sanden <hv@crypt.org>
Date: Fri, 28 Oct 2016 13:27:23 +0100
Subject: [PATCH] [perl #130001] h2xs: avoid infinite loop for enums
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
'typedef enum x { ... } x' causes h2xs to enter a substitution loop while
trying to write the typemap file.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
utils/h2xs.PL | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/utils/h2xs.PL b/utils/h2xs.PL
index 8fda87b..f9063cb 100644
--- a/utils/h2xs.PL
+++ b/utils/h2xs.PL
@@ -1034,7 +1034,7 @@ if( ! $opt_X ){ # use XS, unless it was disabled
}
}
{ local $" = '|';
- $typedef_rex = qr(\b(?<!struct )(?:@good_td)\b) if @good_td;
+ $typedef_rex = qr(\b(?<!struct )(?<!enum )(?:@good_td)\b) if @good_td;
}
%known_fnames = map @$_[1,3], @$fdecls_parsed; # [1,3] is NAME, FULLTEXT
if ($fmask) {
--
2.7.4

View File

@ -211,6 +211,10 @@ Patch55: perl-5.24.0-rt-129336-perl-i-u-erroneously-interpreted-as-u.patc
# in upstream after 5.25.6
Patch56: perl-5.24.0-regcomp.c-fix-perl-129950-fix-firstchar-bitmap-under.patch
# Avoid infinite loop in h2xs tool if enum and type have the same name,
# RT#130001, in upstream after 5.25.6
Patch57: perl-5.25.6-perl-130001-h2xs-avoid-infinite-loop-for-enums.patch
# Link XS modules to libperl.so with EU::CBuilder on Linux, bug #960048
Patch200: perl-5.16.3-Link-XS-modules-to-libperl.so-with-EU-CBuilder-on-Li.patch
@ -2890,6 +2894,7 @@ Perl extension for Version Objects
%patch54 -p1
%patch55 -p1
%patch56 -p1
%patch57 -p1
%patch200 -p1
%patch201 -p1
@ -2937,6 +2942,7 @@ perl -x patchlevel.h \
'Fedora Patch54: Fix crash when matching UTF-8 string with non-UTF-8 substrings (RT#129350)' \
'Fedora Patch55: Fix parsing perl options in shell bang line (RT#129336)' \
'Fedora Patch56: Fix firstchar bitmap under UTF-8 with prefix optimization (RT#129950)' \
'Fedora Patch57: Avoid infinite loop in h2xs tool if enum and type have the same name (RT130001)' \
'Fedora Patch200: Link XS modules to libperl.so with EU::CBuilder on Linux' \
'Fedora Patch201: Link XS modules to libperl.so with EU::MM on Linux' \
%{nil}
@ -5222,6 +5228,8 @@ popd
- Fix crash when matching UTF-8 string with non-UTF-8 substrings (RT#129350)
- Fix parsing perl options in shell bang line (RT#129336)
- Fix firstchar bitmap under UTF-8 with prefix optimization (RT#129950)
- Avoid infinite loop in h2xs tool if enum and type have the same name
(RT130001)
* Fri Sep 02 2016 Petr Pisar <ppisar@redhat.com> - 4:5.24.0-378
- perl-core depends on Parse::CPAN::Meta module instead of package name to allow