summaryrefslogtreecommitdiff
path: root/src/thread.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2019-03-25 08:47:57 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2019-03-25 09:03:29 -0700
commitb7a98993789d18bc675798d49038982d5cf41683 (patch)
tree664630027dfc0918c3fa61156435250063057e1d /src/thread.h
parent176ababa8cf57564cf9374c15ffdc14fa76be39f (diff)
downloademacs-b7a98993789d18bc675798d49038982d5cf41683.tar.gz
Fix some integer issues in regex-emacs
Also, remove some duplicate comments related to thread.h. * src/regex-emacs.h (struct re_registers): * src/regex-emacs.c (SIGN_EXTEND_CHAR): Remove. (TALLOC, RETALLOC): Remove. All uses replaced by usual allocators, which check for integer overflow. (extract_number): Redo without using ‘unsigned’. (CHARSET_RANGE_TABLE_EXISTS_P): Clearly return a boolean. (print_fastmap, print_partial_compiled_pattern, CHECK_INFINITE_LOOP) (regex_compile, analyze_first, bcmp_translate, mutually_exclusive_p) (re_match_2_internal): Use bool for booleans. (print_fastmap, regex_compile, execute_charset): Prefer int to unsigned where either will do. (print_double_string): Prefer ptrdiff_t to ssize_t, since the latter can in theory be narrower than the former. Use fwrite instead of repeated putchar. (emacs_re_max_failures, fail_stack_type, compile_stack_type) (re_wctype_parse, regex_compile, re_search, re_search_2) (re_match_2, re_match_2_internal, re_compile_pattern): Prefer ptrdiff_t to size_t where either will do. (union fail_stack_elt, PUSH_FAILURE_REG, POP_FAILURE_REG_OR_COUNT): Make the integer an intptr_t, not long. (GET_BUFFER_SPACE, EXTEND_BUFFER, regex_compile): Use xpalloc to simplify allocation. (regex_compile): Check for integer overflow when calculating register numbers. * src/regex-emacs.c (re_set_registers, re_match_2_internal): * src/regex-emacs.h (struct re_registers, struct re_pattern_buffer): * src/search.c (Freplace_match): Prefer ptrdiff_t to unsigned where either will do. * src/regex-emacs.h (struct re_pattern_buffer): Prefer bool_bf to unsigned where either will do.
Diffstat (limited to 'src/thread.h')
-rw-r--r--src/thread.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/thread.h b/src/thread.h
index cb7e60f21f8..1856fddf4cd 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -111,8 +111,8 @@ struct thread_state
struct buffer *m_current_buffer;
#define current_buffer (current_thread->m_current_buffer)
- /* Every call to re_match_2, etc., must pass &search_regs as the regs
- argument unless you can show it is unnecessary (i.e., if re_match_2
+ /* Every call to re_search, etc., must pass &search_regs as the regs
+ argument unless you can show it is unnecessary (i.e., if re_search
is certainly going to be called again before region-around-match
can be called).