Mercurial > hg > xemacs-beta
diff src/regex.c @ 5680:8a2ac78cb97d
Pre-emptively update any dirty mirror syntax table before searching
src/ChangeLog addition:
2012-09-02 Aidan Kehoe <kehoea@parhasard.net>
* regex.c (re_search_2):
* regex.c (re_match_2):
If the mirror syntax table is dirty, update it before the search,
preventing a malloc() inside the search code, something which
isn't allowed. Thank you Henry Thompson!
tests/ChangeLog addition:
2012-09-02 Aidan Kehoe <kehoea@parhasard.net>
* automated/regexp-tests.el:
Make sure we can search for character ranges successfully when the
syntax table is dirty.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sun, 02 Sep 2012 17:36:47 +0100 |
parents | 3df910176b6a |
children | e2fae7783046 |
line wrap: on
line diff
--- a/src/regex.c Sun Sep 02 14:31:40 2012 +0100 +++ b/src/regex.c Sun Sep 02 17:36:47 2012 +0100 @@ -4663,6 +4663,7 @@ #ifdef emacs BEGIN_REGEX_MALLOC_OK (); + update_mirror_syntax_if_dirty (BUFFER_MIRROR_SYNTAX_TABLE (lispbuf)); scache = setup_syntax_cache (scache, lispobj, lispbuf, offset_to_charxpos (lispobj, startpos), 1); @@ -5052,6 +5053,10 @@ int result; #ifdef emacs + /* Update the mirror syntax table if it's dirty now, this would otherwise + cause a malloc() in charset_mule in re_match_2_internal() when checking + characters' syntax. */ + update_mirror_syntax_if_dirty (BUFFER_MIRROR_SYNTAX_TABLE (lispbuf)); scache = setup_syntax_cache (scache, lispobj, lispbuf, offset_to_charxpos (lispobj, pos), 1);