fix byte_order_is_valid function logic

Signed-off-by: hubin <hubin73@huawei.com>
This commit is contained in:
hubin 2022-12-16 14:29:34 +08:00
parent 4150e11602
commit b3be7112d6
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,31 @@
From dd49933f80043f933bc10e2f0f1c6d3e664475ed Mon Sep 17 00:00:00 2001
From: hubin <hubin73@huawei.com>
Date: Fri, 16 Dec 2022 09:24:50 +0800
Subject: [PATCH] fix byte_order_is_valid function logic
byte_order_is_valid is an inline function extracted from unw_create_addr_space
in libunwind 1.6, currently its logic mismatches the function intention.
Signed-off-by: hubin <hubin73@huawei.com>
---
include/libunwind_i.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/libunwind_i.h b/include/libunwind_i.h
index fea5c26..9742267 100644
--- a/include/libunwind_i.h
+++ b/include/libunwind_i.h
@@ -119,8 +119,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
static inline int
byte_order_is_valid(int byte_order)
{
- return byte_order != UNW_BIG_ENDIAN
- && byte_order != UNW_LITTLE_ENDIAN;
+ return byte_order == UNW_BIG_ENDIAN
+ || byte_order == UNW_LITTLE_ENDIAN;
}
static inline int
--
2.33.0

View File

@ -1,12 +1,14 @@
Name: libunwind
Epoch: 2
Version: 1.6.2
Release: 2
Release: 3
Summary: Libunwind provides a C ABI to determine the call-chain of a program
License: BSD
URL: http://savannah.nongnu.org/projects/libunwind
Source: http://download-mirror.savannah.gnu.org/releases/libunwind/libunwind-%{version}.tar.gz
Patch0001: 0001-fix-byte_order_is_valid-function-logic.patch
ExclusiveArch: aarch64 %{ix86} x86_64 riscv64
BuildRequires: automake libtool autoconf texlive-latex2man
@ -84,6 +86,12 @@ make check || true
%{_mandir}/*/*
%changelog
* Fri Dec 16 2022 Bin Hu <hubin73@huawei.com> - 2:1.6.2-3
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix byte_order_is_valid function logic
* Tue Apr 26 2022 renhongxun <renhongxun@h-partners.com>-2:1.6.2-2
- Type:update
- ID:NA