This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regexec.c: Fix UNLIKELY() scope
authorKarl Williamson <khw@cpan.org>
Thu, 16 Aug 2018 20:54:23 +0000 (14:54 -0600)
committerKarl Williamson <khw@cpan.org>
Thu, 16 Aug 2018 22:20:12 +0000 (16:20 -0600)
The expression as a whole is unlikely to be true, not just the portion
that was marked so.

regexec.c

index d0c4e6b..8410813 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -10465,7 +10465,7 @@ Perl_isSCRIPT_RUN(pTHX_ const U8 * s, const U8 * send, const bool utf8_target)
          * one to use, and the character is in that sequence.  Now that we know
          * the script, we can use script_zeros[] to directly find which
          * sequence the script uses, except in a few cases it returns 0 */
-        if (UNLIKELY(zero_of_run == 0) && script_of_char >= 0) {
+        if (UNLIKELY(zero_of_run == 0 && script_of_char >= 0)) {
             zero_of_run = script_zeros[script_of_char];
         }