From: Eric Biggers Date: Thu, 11 Dec 2014 01:14:40 +0000 (-0600) Subject: Annotate yet another unaligned memory access X-Git-Tag: v1.7.4~40 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=f6ac8c7224155b283c8ffa180ff720e2e8291144 Annotate yet another unaligned memory access --- diff --git a/src/lz_binary_trees.c b/src/lz_binary_trees.c index 4a0537cb..fa866b89 100644 --- a/src/lz_binary_trees.c +++ b/src/lz_binary_trees.c @@ -437,7 +437,7 @@ lz_bt_get_matches(struct lz_mf *_mf, struct lz_match matches[]) /* Search the digram table for a length 2 match. */ const u16 digram = mf->next_digram; - mf->next_digram = *(const u16 *)(&window[cur_pos + 1]); + mf->next_digram = load_u16_unaligned(&window[cur_pos + 1]); prefetch(&mf->digram_tab[mf->next_digram]); cur_match = mf->digram_tab[digram]; mf->digram_tab[digram] = cur_pos; @@ -563,7 +563,7 @@ lz_bt_skip_positions(struct lz_mf *_mf, u32 n) do { if (mf->digram_tab) { digram = next_digram; - next_digram = *(const u16 *)(&window[cur_pos + 1]); + next_digram = load_u16_unaligned(&window[cur_pos + 1]); mf->digram_tab[digram] = cur_pos; }