diff options
author | David Turner <dturner@twopensource.com> | 2014-07-05 12:00:59 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-07-07 11:05:43 -0700 |
commit | 6d17dc1dd3909a9e8a5a915a6ff15d4c64c58290 (patch) | |
tree | 051e2e1597e5aec8d9374d85200ce680b5597be2 /refs.c | |
parent | 745224e04a03e4544c58d5d38d3c54f67100f8eb (diff) | |
download | git-6d17dc1dd3909a9e8a5a915a6ff15d4c64c58290.tar.gz git-6d17dc1dd3909a9e8a5a915a6ff15d4c64c58290.tar.xz |
refs.c: handle REFNAME_REFSPEC_PATTERN at end of page
When a ref crosses a memory page boundary, we restart the parsing
at the beginning with the bytewise code. Pass the original flags
to that code, rather than the current flags.
Reported-By: Øyvind A. Holm <sunny@sunbase.org>
Signed-off-by: David Turner <dturner@twitter.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -153,6 +153,7 @@ int check_refname_format(const char *refname, int flags) const __m128i tilde_lb = _mm_set1_epi8('~' - 1); int component_count = 0; + int orig_flags = flags; if (refname[0] == 0 || refname[0] == '/') { /* entirely empty ref or initial ref component */ @@ -178,7 +179,7 @@ int check_refname_format(const char *refname, int flags) * End-of-page; fall back to slow method for * this entire ref. */ - return check_refname_format_bytewise(refname, flags); + return check_refname_format_bytewise(refname, orig_flags); tmp = _mm_loadu_si128((__m128i *)cp); tmp1 = _mm_loadu_si128((__m128i *)(cp + 1)); |