OSDN Git Service

[lldb] Fix nondeterminism in TestCppBitfields
authorPavel Labath <pavel@labath.sk>
Fri, 24 Jan 2020 11:02:43 +0000 (12:02 +0100)
committerPavel Labath <pavel@labath.sk>
Fri, 24 Jan 2020 11:09:20 +0000 (12:09 +0100)
commit77cedb0cdb8623ff9eb22dbf3b9302ee4d9f8a20
tree5fac65f360de19c0884587f87ea0d7adba7bf1c5
parent0ae13766ffd854ec0e88f2b9dc7461bdd7b60479
[lldb] Fix nondeterminism in TestCppBitfields

The test was printing a char[3] variable without a terminating nul. The
memory after that variable (an unnamed bitfield) was not initialized. If
the memory happened to be nonzero, the summary provider for the variable
would run off into the next field.

This is probably not the right behavior (it should stop at the end of
the array), but this is not the purpose of this test. I have filed
pr44649 for this bug, and fixed the test to not depend on this behavior.
lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/TestCppBitfields.py
lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/main.cpp