summaryrefslogtreecommitdiffstats
path: root/test-absolute-path.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2007-10-03 07:44:15 +0200
committerJunio C Hamano <gitster@pobox.com>2007-10-03 08:18:58 +0200
commit95af39fcb2d84c8ef2844a9d890e3c67a2e0e1ec (patch)
treea75ca427b6832c01aded76499c4fb203a7619da5 /test-absolute-path.c
parentthe ar tool is called gar on some systems (diff)
downloadgit-95af39fcb2d84c8ef2844a9d890e3c67a2e0e1ec.tar.xz
git-95af39fcb2d84c8ef2844a9d890e3c67a2e0e1ec.zip
Must not modify the_index.cache as it may be passed to realloc at some point.
The index cache is not static, growing as new entries are added. If entries are added after prune_cache is called, cache will no longer point at the base of the allocation, and realloc will not be happy. I verified that this was the only place in the current source which modified any index_state.cache elements aside from the alloc/realloc calls in read-cache by changing the type of the element to 'struct cache_entry ** const cache' and recompiling. A more efficient patch would create a separate 'cache_base' value to track the allocation and then fix things up when reallocation was necessary, instead of the brute-force memmove used here. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'test-absolute-path.c')
0 files changed, 0 insertions, 0 deletions