Fix w32 memory-management problem when extending buffer text
* src/w32heap.c (mmap_realloc): Only attempt extending a region if the following region has the same allocation base. Also, use the original allocation base and enlarged size to commit reserved memory, to ensure that the allocation base stays at its original value. This fixes several hard-to-debug problems whereby part of buffer text was overwritten with binary nulls, because mmap_realloc copied only part of buffer text when extending it. See http://lists.gnu.org/archive/html/emacs-devel/2016-04/msg00325.html and http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23223#55 for two examples of the related problems.
Showing with 4 additions and 4 deletions