683572
From 4f0ded009bf6de2da6a2a2022bec03576dcb80ca Mon Sep 17 00:00:00 2001
683572
From: Karl Williamson <khw@cpan.org>
683572
Date: Wed, 1 May 2019 10:41:38 -0600
683572
Subject: [PATCH] pp.c: Add two UNLIKELY()s
683572
MIME-Version: 1.0
683572
Content-Type: text/plain; charset=UTF-8
683572
Content-Transfer-Encoding: 8bit
683572
683572
It should be uncommon to shift beyond a full word
683572
683572
Signed-off-by: Ported to 5.30.0 from
683572
bae047b68c92622bb4bb04499e36cdaa48138909.
683572
Signed-off-by: Petr Písař <ppisar@redhat.com>
683572
---
683572
 pp.c | 4 ++--
683572
 1 file changed, 2 insertions(+), 2 deletions(-)
683572
683572
diff --git a/pp.c b/pp.c
683572
index 90db3a0..7afb090 100644
683572
--- a/pp.c
683572
+++ b/pp.c
683572
@@ -1979,7 +1979,7 @@ static UV S_uv_shift(UV uv, int shift, bool left)
683572
        shift = -shift;
683572
        left = !left;
683572
    }
683572
-   if (shift >= IV_BITS) {
683572
+   if (UNLIKELY(shift >= IV_BITS)) {
683572
        return 0;
683572
    }
683572
    return left ? uv << shift : uv >> shift;
683572
@@ -1991,7 +1991,7 @@ static IV S_iv_shift(IV iv, int shift, bool left)
683572
        shift = -shift;
683572
        left = !left;
683572
    }
683572
-   if (shift >= IV_BITS) {
683572
+   if (UNLIKELY(shift >= IV_BITS)) {
683572
        return iv < 0 && !left ? -1 : 0;
683572
    }
683572
    return left ? iv << shift : iv >> shift;
683572
-- 
683572
2.20.1
683572