diff options
author | Alex Langford <alangford@apple.com> | 2025-10-17 11:02:11 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-10-17 11:02:11 -0700 |
commit | 40d4ea6342c736cb1c71af350a0cf7953a3bbb80 (patch) | |
tree | 77a7140bb3588c0ee6e113b1f47b0cb43c17abe0 /clang/lib/InstallAPI/HeaderFile.cpp | |
parent | e29cf8e22aaa3a7d1a6d5061cc6c8e7763074c0b (diff) | |
download | llvm-40d4ea6342c736cb1c71af350a0cf7953a3bbb80.zip llvm-40d4ea6342c736cb1c71af350a0cf7953a3bbb80.tar.gz llvm-40d4ea6342c736cb1c71af350a0cf7953a3bbb80.tar.bz2 |
[lldb] Fix misaligned loads violation in DataExtractor (#163880)
The implementation of the templated `Get` function contains UB. For
example, the "GetDoubleUnaligned" unit test causes `Get` to perform an
unaligned 8 byte read. This violates the `double` alignment requirement.
Furthermore, it violates strict aliasing rules in C++. (We construct a
`const double *` from a `const uint8_t *` and perform a read on the
resulting double pointer).
DataExtractor should be able to read unaligned data to deal with
different data formats, but we need to be careful to not perform
unaligned reads/writes or violate strict aliasing rules.
rdar://160385383
Diffstat (limited to 'clang/lib/InstallAPI/HeaderFile.cpp')
0 files changed, 0 insertions, 0 deletions