Skip to content
Commit 18d27fa1 authored by Noel Gordon's avatar Noel Gordon Committed by Copybara-Service
Browse files

[zlib] make insert_string_simd load window data with zmemcpy

Undefined behavior santizer (UBSan) notes that window data loaded
using the existing code makes C++ compilers unhappy.

C++ Compilers expect data alignment: so loading from an unaligned
object is undefined C++ behaviour.

Fix this: use zmemcpy to load the window data. All optimizing C++
tested (see bug) output the same instruction sequence, before and
after this change. So no change in performance.

Bug: 1399295
Test: zlib_bench gzip --compression 6 ~/snappy/testdata/*
Change-Id: I90cfd66c803686c3834d88c3bc33833216598836
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4086462


Reviewed-by: default avatarAdenilson Cavalcanti <cavalcantii@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1080742}
NOKEYCHECK=True
GitOrigin-RevId: 36bfeb91012cd6c6897eda645e5375abf14c1c01
parent d866d41e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment