From 26070944c186aa244c94f054fc8fcaf1110e2e25 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Thu, 11 Jul 2013 19:44:56 -0600 Subject: [PATCH] regcomp.c: Reorder a couple of function calls A future commit with require that the offset be known before the length gets set. This prepares for that. --- regcomp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/regcomp.c b/regcomp.c index 284ca6a..f109681 100644 --- a/regcomp.c +++ b/regcomp.c @@ -7270,9 +7270,10 @@ S__new_invlist_C_array(pTHX_ const UV* const list) * when that adjustment wasn't needed. That happens when the offset was 0; * the exclusive-or flips the 0 to 1, and vice versa */ SvCUR_set(invlist, TO_INTERNAL_SIZE(length - (offset ^ 1))); + *(get_invlist_offset_addr(invlist)) = offset; invlist_set_len(invlist, length); - *(get_invlist_offset_addr(invlist)) = offset; + invlist_set_previous_index(invlist, 0); /* Initialize the iteration pointer. */ @@ -8140,9 +8141,9 @@ S_invlist_clone(pTHX_ SV* const invlist) PERL_ARGS_ASSERT_INVLIST_CLONE; SvCUR_set(new_invlist, physical_length); /* This isn't done automatically */ - invlist_set_len(new_invlist, _invlist_len(invlist)); *(get_invlist_offset_addr(new_invlist)) = *(get_invlist_offset_addr(invlist)); + invlist_set_len(new_invlist, _invlist_len(invlist)); Copy(SvPVX(invlist), SvPVX(new_invlist), physical_length, char); return new_invlist; -- 2.7.4