From 6d17dc1dd3909a9e8a5a915a6ff15d4c64c58290 Mon Sep 17 00:00:00 2001 From: David Turner Date: Sat, 5 Jul 2014 12:00:59 -0700 Subject: refs.c: handle REFNAME_REFSPEC_PATTERN at end of page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: David Turner Signed-off-by: Junio C Hamano --- refs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/refs.c b/refs.c index 25117fe0cd..39871977ed 100644 --- a/refs.c +++ b/refs.c @@ -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)); -- cgit v1.2.3