OSDN Git Service

[lldb] Fix unaligned load in DataExtractor
authorJonas Devlieghere <jonas@devlieghere.com>
Tue, 7 Jul 2020 17:12:17 +0000 (10:12 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Tue, 7 Jul 2020 17:13:41 +0000 (10:13 -0700)
commit5e9b16b67f5b9543e8d22b5b0f22cc0980c310bd
treed42b25036a87cd934a792c52889781283f5367b1
parent7fc279ca3d414c0997998cb30d1adc2c63c837a5
[lldb] Fix unaligned load in DataExtractor

Somehow UBSan would only report the unaligned load in TestLinuxCore.py
when running the tests with reproducers. This patch fixes the issue by
using a memcpy in the GetDouble and the GetFloat method.

Differential revision: https://reviews.llvm.org/D83256
lldb/include/lldb/Utility/DataExtractor.h
lldb/source/Utility/DataExtractor.cpp
lldb/unittests/Utility/DataExtractorTest.cpp