libunwind/0001-fix-byte_order_is_valid-function-logic.patch

32 lines
980 B
Diff
Raw Permalink Normal View History

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