diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2020-08-26 00:07:09 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2020-08-26 00:20:31 -0700 |
commit | e823709d1755cb4fd087f2a9ba92d350dd32fe47 (patch) | |
tree | 4ad4c54b18cc30ea8128b9619cf50504f2b45434 /src/regex-emacs.c | |
parent | bd5771ff27dbbb2b09cc7c14f1ac040234285acc (diff) | |
download | emacs-e823709d1755cb4fd087f2a9ba92d350dd32fe47.tar.gz |
regex-emacs: copy less when reallocating
* src/regex-emacs.c (GROW_FAIL_STACK): Copy just the
occupied stack slots, as the rest are garbage.
Diffstat (limited to 'src/regex-emacs.c')
-rw-r--r-- | src/regex-emacs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/regex-emacs.c b/src/regex-emacs.c index 3d8aaf4bb13..971a5f63749 100644 --- a/src/regex-emacs.c +++ b/src/regex-emacs.c @@ -929,7 +929,7 @@ typedef struct ? 0 \ : ((fail_stack).stack \ = REGEX_REALLOCATE ((fail_stack).stack, \ - (fail_stack).size * sizeof (fail_stack_elt_t), \ + (fail_stack).avail * sizeof (fail_stack_elt_t), \ min (emacs_re_max_failures * TYPICAL_FAILURE_SIZE, \ ((fail_stack).size * FAIL_STACK_GROWTH_FACTOR)) \ * sizeof (fail_stack_elt_t)), \ |