Currently the code looks like:
if (rx_origin + start_shift >= check_at)
goto retry_floating_check;
....
retry_floating_check:
rx_origin = check_at - start_shift;
goto hop_and_restart;
But that conditional only kicks in when the floating substring (which was
the check substring) matched, so this condition always applies:
rx_origin + start_shift <= check_at
So the condition in the code will only ever be true when
rx_origin + start_shift == check_at
In this case, this assignment is a noop:
rx_origin = check_at - start_shift;
So skip it and jump directly to hop_and_restart. This eliminates the
retry_floating_check: label.
goto restart;
}
/* Have both, check_string is floating */
- if (rx_origin + start_shift >= check_at) /* Contradicts floating=check */
- goto retry_floating_check;
+ assert(rx_origin + start_shift <= check_at);
+ if (rx_origin + start_shift == check_at)
+ /* already at latest position float substr could match */
+ goto hop_and_restart;
/* Recheck anchored substring, but not floating... */
if (!check) {
rx_origin = NULL;
if (!(utf8_target ? prog->float_utf8 : prog->float_substr)) /* Could have been deleted */
goto fail;
/* Check is floating substring. */
- retry_floating_check:
rx_origin = check_at - start_shift;
goto hop_and_restart;
}