From 8956d6bbd3e154210ad79d521da01a7154d892d1 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 8 Nov 2023 19:03:53 +0100 Subject: [PATCH] Fix UB unaligned load --- libunicode.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libunicode.c b/libunicode.c index 63c12a0..332a64a 100644 --- a/libunicode.c +++ b/libunicode.c @@ -159,11 +159,7 @@ int lre_case_conv(uint32_t *res, uint32_t c, int conv_type) static uint32_t get_le24(const uint8_t *ptr) { -#if defined(__x86__) || defined(__x86_64__) - return *(uint16_t *)ptr | (ptr[2] << 16); -#else return ptr[0] | (ptr[1] << 8) | (ptr[2] << 16); -#endif } #define UNICODE_INDEX_BLOCK_LEN 32