summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2020-01-24 12:02:43 +0100
committerHans Wennborg <hans@chromium.org>2020-01-28 14:24:36 +0100
commit54b022d344412fc9f1dfe37ee05de934a01e1ea4 (patch)
treec6c2996b81f006a4fd4f43d41fc37bdf82c6280c /lldb/packages/Python
parent6472fec9a6998a2efd61137f90ace9f4c9dc76f1 (diff)
downloadbcm5719-llvm-54b022d344412fc9f1dfe37ee05de934a01e1ea4.tar.gz
bcm5719-llvm-54b022d344412fc9f1dfe37ee05de934a01e1ea4.zip
[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. (cherry picked from commit 77cedb0cdb8623ff9eb22dbf3b9302ee4d9f8a20)
Diffstat (limited to 'lldb/packages/Python')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/TestCppBitfields.py2
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/main.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/TestCppBitfields.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/TestCppBitfields.py
index 696e5647f13..1b362e6b04f 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/TestCppBitfields.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/TestCppBitfields.py
@@ -80,7 +80,7 @@ class CppBitfieldsTestCase(TestBase):
"frame variable --show-types lbd",
VARIABLES_DISPLAYED_CORRECTLY,
substrs=[
- '(char [3]) arr = "abc"',
+ '(char [3]) arr = "ab"',
'(int:32) =',
'(unsigned int:20) a = 5',
])
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/main.cpp b/lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/main.cpp
index 975c0f05683..e43bf8c138e 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/main.cpp
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/main.cpp
@@ -73,7 +73,7 @@ int main(int argc, char const *argv[]) {
lbd.arr[0] = 'a';
lbd.arr[1] = 'b';
- lbd.arr[2] = 'c';
+ lbd.arr[2] = '\0';
lbd.a = 5;
OpenPOWER on IntegriCloud