llvm-project/lldb/unittests/Core
Bryan Chan 01319e93ab Avoid an assertion failure when a bit field is extracted from a value of the same size.
Summary: One of the cases handled by ValueObjectChild::UpdateValue() uses the entire width of the parent's scalar value as the size of the child, and extracts the child by calling Scalar::ExtractBitfield(). This seems valid but APInt::trunc(), APInt::sext() and APInt::zext() assert that the bit field must not have the same size as the parent scalar. Replacing those calls with sextOrTrunc(), zextOrTrunc(), sextOrSelf() and zextOrSelf() fixes the assertion failures.

Reviewers: uweigand, labath

Subscribers: labath, lldb-commits

Differential Revision: http://reviews.llvm.org/D20355

llvm-svn: 270062
2016-05-19 13:51:20 +00:00
..
CMakeLists.txt Handle bit fields on big-endian systems correctly 2016-04-14 14:32:57 +00:00
DataExtractorTest.cpp Handle bit fields on big-endian systems correctly 2016-04-14 14:32:57 +00:00
ScalarTest.cpp Avoid an assertion failure when a bit field is extracted from a value of the same size. 2016-05-19 13:51:20 +00:00