1 |
vapier 12/01/01 09:43:26 |
2 |
|
3 |
Added: 0090_all_glibc-2.14-fix-up-regcomp-regexec.patch |
4 |
Log: |
5 |
fix from upstream and random regex miscompiles with newer gcc versions |
6 |
|
7 |
Revision Changes Path |
8 |
1.1 src/patchsets/glibc/2.14.1/0090_all_glibc-2.14-fix-up-regcomp-regexec.patch |
9 |
|
10 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.14.1/0090_all_glibc-2.14-fix-up-regcomp-regexec.patch?rev=1.1&view=markup |
11 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.14.1/0090_all_glibc-2.14-fix-up-regcomp-regexec.patch?rev=1.1&content-type=text/plain |
12 |
|
13 |
Index: 0090_all_glibc-2.14-fix-up-regcomp-regexec.patch |
14 |
=================================================================== |
15 |
in upstream glibc already |
16 |
|
17 |
From 2ba92745c36eb3c3f3af0ce1b0aebd255c63a13b Mon Sep 17 00:00:00 2001 |
18 |
From: Jakub Jelinek <jakub@××××××.com> |
19 |
Date: Fri, 30 Dec 2011 17:13:56 -0500 |
20 |
Subject: [PATCH] Fix up regcomp/regexec |
21 |
|
22 |
The problem is that parse_bracket_symbol is miscompiled, and it turns |
23 |
out it is because of an incorrect attribute on re_string_fetch_byte_case. |
24 |
Unlike re_string_peek_byte_case, this one is really not pure, it modifies memory |
25 |
(increments pstr->cur_idx), and with the pure attribute GCC assumed it doesn't |
26 |
and it cached the presumed value of regexp->cur_idx in a variable across the |
27 |
for (;; ++i) |
28 |
{ |
29 |
if (i >= BRACKET_NAME_BUF_SIZE) |
30 |
return REG_EBRACK; |
31 |
if (token->type == OP_OPEN_CHAR_CLASS) |
32 |
ch = re_string_fetch_byte_case (regexp); |
33 |
else |
34 |
ch = re_string_fetch_byte (regexp); |
35 |
if (re_string_eoi(regexp)) |
36 |
return REG_EBRACK; |
37 |
if (ch == delim && re_string_peek_byte (regexp, 0) == ']') |
38 |
break; |
39 |
elem->opr.name[i] = ch; |
40 |
} |
41 |
--- |
42 |
ChangeLog | 5 +++++ |
43 |
posix/regex_internal.c | 2 +- |
44 |
2 files changed, 6 insertions(+), 1 deletions(-) |
45 |
|
46 |
2011-12-30 Jakub Jelinek <jakub@××××××.com> |
47 |
|
48 |
* posix/regex_internal.c (re_string_fetch_byte_case): Remove |
49 |
pure attribute. |
50 |
|
51 |
diff --git a/posix/regex_internal.c b/posix/regex_internal.c |
52 |
index bc19243..124f8cc 100644 |
53 |
--- a/posix/regex_internal.c |
54 |
+++ b/posix/regex_internal.c |
55 |
@@ -868,7 +868,7 @@ re_string_peek_byte_case (const re_string_t *pstr, int idx) |
56 |
} |
57 |
|
58 |
static unsigned char |
59 |
-internal_function __attribute ((pure)) |
60 |
+internal_function |
61 |
re_string_fetch_byte_case (re_string_t *pstr) |
62 |
{ |
63 |
if (BE (!pstr->mbs_allocated, 1)) |
64 |
-- |
65 |
1.7.6.1 |