diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2019-02-06 08:44:13 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2019-02-06 08:44:13 +0000 |
commit | bb3609e49d806904c80a6a6047e83ed5a65b0f24 (patch) | |
tree | b8b9ede9fbb24c1a546cbfa8ce72a858a2392fad /lldb/packages/Python/lldbsuite/test/lang/cpp/scope/main.cpp | |
parent | b8ee8c8517b67be8f7837b7773a9325222aff5b0 (diff) | |
download | bcm5719-llvm-bb3609e49d806904c80a6a6047e83ed5a65b0f24.tar.gz bcm5719-llvm-bb3609e49d806904c80a6a6047e83ed5a65b0f24.zip |
Fix strlen() of unbound array undefined behavior
LLDB testsuite fails when built by GCC8 on:
LLDB :: SymbolFile/DWARF/find-basic-namespace.cpp
This is because this code in LLDB codebase has undefined behavior:
#include <algorithm>
#include <string.h>
// lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp:1731
static struct section_64 {
char sectname[16];
char segname[16];
} sect64 = { {'_','_','a','p','p','l','e','_','n','a','m','e','s','p','a','c'}, "__DWARF" };
int main() {
return std::min<size_t>(strlen(sect64.sectname), sizeof(sect64.sectname));
}
It has been discussed as a (false) bugreport to GCC:
wrong-code: LLDB testcase fails: SymbolFile/DWARF/find-basic-namespace.cpp
https://bugzilla.redhat.com/show_bug.cgi?id=1672436
Differential Revision: https://reviews.llvm.org/D57781
llvm-svn: 353280
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lang/cpp/scope/main.cpp')
0 files changed, 0 insertions, 0 deletions