diff options
| author | Eli Zaretskii | 2012-05-29 19:01:05 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2012-05-29 19:01:05 +0300 |
| commit | a02ae4e5bfa13097dabee45f45ee992cdb830bb3 (patch) | |
| tree | 087dd2026ed1f059c967bbde9471d1257b982dcf | |
| parent | 291d430f5f184c8a9438eace09b141131de343e8 (diff) | |
| download | emacs-a02ae4e5bfa13097dabee45f45ee992cdb830bb3.tar.gz emacs-a02ae4e5bfa13097dabee45f45ee992cdb830bb3.zip | |
Don't call r_alloc_inhibit_buffer_relocation from search.c.
src/search.c (search_buffer): Remove calls to
r_alloc_inhibit_buffer_relocation, as it is now called by
maybe_unify_char, which was the cause of relocation of buffer text
in bug#11519.
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/search.c | 20 |
2 files changed, 7 insertions, 20 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index ec5725af2bc..16bd1659b34 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2012-05-29 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * search.c (search_buffer): Remove calls to | ||
| 4 | r_alloc_inhibit_buffer_relocation, as it is now called by | ||
| 5 | maybe_unify_char, which was the cause of relocation of buffer text | ||
| 6 | in bug#11519. | ||
| 7 | |||
| 1 | 2012-05-23 Eli Zaretskii <eliz@gnu.org> | 8 | 2012-05-23 Eli Zaretskii <eliz@gnu.org> |
| 2 | 9 | ||
| 3 | * charset.c (maybe_unify_char): Inhibit relocation of buffer text | 10 | * charset.c (maybe_unify_char): Inhibit relocation of buffer text |
diff --git a/src/search.c b/src/search.c index 67f9e505fad..26fc7396555 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -1159,24 +1159,12 @@ search_buffer (Lisp_Object string, EMACS_INT pos, EMACS_INT pos_byte, | |||
| 1159 | { | 1159 | { |
| 1160 | EMACS_INT val; | 1160 | EMACS_INT val; |
| 1161 | 1161 | ||
| 1162 | #ifdef REL_ALLOC | ||
| 1163 | /* re_search_2 below is passed C pointers to buffer text. | ||
| 1164 | If some code called by it causes memory (re)allocation, | ||
| 1165 | buffer text could be relocated on platforms that use | ||
| 1166 | REL_ALLOC, which invalidates those C pointers. So we | ||
| 1167 | inhibit relocation of buffer text for as long as | ||
| 1168 | re_search_2 runs. */ | ||
| 1169 | r_alloc_inhibit_buffer_relocation (1); | ||
| 1170 | #endif | ||
| 1171 | val = re_search_2 (bufp, (char *) p1, s1, (char *) p2, s2, | 1162 | val = re_search_2 (bufp, (char *) p1, s1, (char *) p2, s2, |
| 1172 | pos_byte - BEGV_BYTE, lim_byte - pos_byte, | 1163 | pos_byte - BEGV_BYTE, lim_byte - pos_byte, |
| 1173 | (NILP (Vinhibit_changing_match_data) | 1164 | (NILP (Vinhibit_changing_match_data) |
| 1174 | ? &search_regs : &search_regs_1), | 1165 | ? &search_regs : &search_regs_1), |
| 1175 | /* Don't allow match past current point */ | 1166 | /* Don't allow match past current point */ |
| 1176 | pos_byte - BEGV_BYTE); | 1167 | pos_byte - BEGV_BYTE); |
| 1177 | #ifdef REL_ALLOC | ||
| 1178 | r_alloc_inhibit_buffer_relocation (0); | ||
| 1179 | #endif | ||
| 1180 | if (val == -2) | 1168 | if (val == -2) |
| 1181 | { | 1169 | { |
| 1182 | matcher_overflow (); | 1170 | matcher_overflow (); |
| @@ -1216,19 +1204,11 @@ search_buffer (Lisp_Object string, EMACS_INT pos, EMACS_INT pos_byte, | |||
| 1216 | { | 1204 | { |
| 1217 | EMACS_INT val; | 1205 | EMACS_INT val; |
| 1218 | 1206 | ||
| 1219 | #ifdef REL_ALLOC | ||
| 1220 | /* See commentary above for the reasons for inhibiting | ||
| 1221 | buffer text relocation here. */ | ||
| 1222 | r_alloc_inhibit_buffer_relocation (1); | ||
| 1223 | #endif | ||
| 1224 | val = re_search_2 (bufp, (char *) p1, s1, (char *) p2, s2, | 1207 | val = re_search_2 (bufp, (char *) p1, s1, (char *) p2, s2, |
| 1225 | pos_byte - BEGV_BYTE, lim_byte - pos_byte, | 1208 | pos_byte - BEGV_BYTE, lim_byte - pos_byte, |
| 1226 | (NILP (Vinhibit_changing_match_data) | 1209 | (NILP (Vinhibit_changing_match_data) |
| 1227 | ? &search_regs : &search_regs_1), | 1210 | ? &search_regs : &search_regs_1), |
| 1228 | lim_byte - BEGV_BYTE); | 1211 | lim_byte - BEGV_BYTE); |
| 1229 | #ifdef REL_ALLOC | ||
| 1230 | r_alloc_inhibit_buffer_relocation (0); | ||
| 1231 | #endif | ||
| 1232 | if (val == -2) | 1212 | if (val == -2) |
| 1233 | { | 1213 | { |
| 1234 | matcher_overflow (); | 1214 | matcher_overflow (); |