Skip to content
Commit 409a7358 authored by John David Anglin's avatar John David Anglin Committed by Noah Goldstein
Browse files

String: test-memcpy used unaligned types for buffers [BZ 28572]



commit d585ba47
Author: Noah Goldstein <goldstein.w.n@gmail.com>
Date:   Mon Nov 1 00:49:48 2021 -0500

    string: Make tests birdirectional test-memcpy.c

Add tests that had src/dst non 4-byte aligned. Since src/dst are
initialized/compared as uint32_t type which is 4-byte aligned this can
break on some targets.

Fix the issue by specifying a new non-aligned 4-byte
`unaligned_uint32_t` for src/dst.

Another alternative is to rely on memcpy/memcmp for
initializing/testing src/dst. Using memcpy for initializing in memcpy
tests, however, could lead to future bugs.

Reviewed-by: default avatarNoah Goldstein <goldstein.w.n@gmail.com>
parent cbab7f72
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment