From 5bc87f1581c4475669427a57b1a3b60bf9d145f2 Mon Sep 17 00:00:00 2001 From: Nathan Moinvaziri Date: Sun, 26 Dec 2021 19:56:12 -0800 Subject: Use memcpy for unaligned reads. Co-authored-by: Matija Skala --- insert_string_tpl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'insert_string_tpl.h') diff --git a/insert_string_tpl.h b/insert_string_tpl.h index ad88275bfc..7d3e46c897 100644 --- a/insert_string_tpl.h +++ b/insert_string_tpl.h @@ -31,7 +31,7 @@ #ifndef HASH_CALC_READ # ifdef UNALIGNED_OK # define HASH_CALC_READ \ - val = *(uint32_t *)(strstart); + memcpy(&val, strstart, sizeof(val)); # else # define HASH_CALC_READ \ val = ((uint32_t)(strstart[0])); \ -- cgit 0.0.5-2-1-g0f52