Skip to content
Commit 8fbe1e76 authored by Daniel Rodríguez Troitiño's avatar Daniel Rodríguez Troitiño
Browse files

[llvm-objcopy] Fix misaligned access to load command data.

It seems that llvm-objcopy stores data temporarily misaligned with the
requirements of the underlaying struct from libBinaryFormat, and UBSan
generates a runtime error.

Instead of trying to reinterpret the memory as the struct itself, simply
access the `char *` pointer that we are interested in, and that do not
have alignment restrictions.

This problem was pointed out in a comment of D111164.

Differential Revision: https://reviews.llvm.org/D112744
parent 3a4b605b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment