Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 6d17dc1

Browse files
dturner-twgitster
authored andcommitted
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 <[email protected]> Signed-off-by: David Turner <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 745224e commit 6d17dc1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

refs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ int check_refname_format(const char *refname, int flags)
153153
const __m128i tilde_lb = _mm_set1_epi8('~' - 1);
154154

155155
int component_count = 0;
156+
int orig_flags = flags;
156157

157158
if (refname[0] == 0 || refname[0] == '/') {
158159
/* entirely empty ref or initial ref component */
@@ -178,7 +179,7 @@ int check_refname_format(const char *refname, int flags)
178179
* End-of-page; fall back to slow method for
179180
* this entire ref.
180181
*/
181-
return check_refname_format_bytewise(refname, flags);
182+
return check_refname_format_bytewise(refname, orig_flags);
182183

183184
tmp = _mm_loadu_si128((__m128i *)cp);
184185
tmp1 = _mm_loadu_si128((__m128i *)(cp + 1));

0 commit comments

Comments
 (0)