From: Tuan Phan Date: Mon, 3 Oct 2022 18:29:21 +0000 (-0700) Subject: kern/compiler-rt: Fix __clzsi2() logic X-Git-Tag: grub-2.12-rc1~258 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34037747033879287864be289abb911a29751634;p=thirdparty%2Fgrub.git kern/compiler-rt: Fix __clzsi2() logic Fix the incorrect return value of __clzsi2() function. Fixes: e795b90 (RISC-V: Add libgcc helpers for clz) Signed-off-by: Tuan Phan Reviewed-by: Daniel Kiper --- diff --git a/grub-core/kern/compiler-rt.c b/grub-core/kern/compiler-rt.c index 2057c2e0c..8948fdf77 100644 --- a/grub-core/kern/compiler-rt.c +++ b/grub-core/kern/compiler-rt.c @@ -431,7 +431,7 @@ __clzsi2 (grub_uint32_t val) for (; j; j >>= 1) { - if ((temp = val) >> j) + if ((temp = val >> j)) { if (j == 1) {