Author: Vitaly Buka Date: 2020-09-17T17:59:52-07:00 New Revision: 03358becbf22a221d6d965ec8f3f7068668f7d29
URL: https://github.com/llvm/llvm-project/commit/03358becbf22a221d6d965ec8f3f7068668f7d29 DIFF: https://github.com/llvm/llvm-project/commit/03358becbf22a221d6d965ec8f3f7068668f7d29.diff LOG: [NFC][Lsan] Fix zero-sized array compilation error Added: Modified: clang/lib/Tooling/Syntax/Synthesis.cpp compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp Removed: ################################################################################ diff --git a/clang/lib/Tooling/Syntax/Synthesis.cpp b/clang/lib/Tooling/Syntax/Synthesis.cpp index 2fe95a40cb32..ea2739523a09 100644 --- a/clang/lib/Tooling/Syntax/Synthesis.cpp +++ b/clang/lib/Tooling/Syntax/Synthesis.cpp @@ -58,6 +58,7 @@ syntax::Tree *allocateTree(syntax::Arena &A, syntax::NodeKind Kind) { switch (Kind) { case syntax::NodeKind::Leaf: assert(false); + break; case syntax::NodeKind::TranslationUnit: return new (A.getAllocator()) syntax::TranslationUnit; case syntax::NodeKind::UnknownExpression: diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp index cf21ab854007..1e71d6512c1f 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp @@ -504,13 +504,13 @@ typedef struct user regs_struct; #elif defined(__aarch64__) typedef struct user_pt_regs regs_struct; #define REG_SP sp -static constexpr uptr kExtraRegs[] = {}; +static constexpr uptr kExtraRegs[] = {0}; #define ARCH_IOVEC_FOR_GETREGSET #elif defined(__s390__) typedef _user_regs_struct regs_struct; #define REG_SP gprs[15] -static constexpr uptr kExtraRegs[] = {}; +static constexpr uptr kExtraRegs[] = {0}; #define ARCH_IOVEC_FOR_GETREGSET #else @@ -578,7 +578,7 @@ PtraceRegistersStatus SuspendedThreadsListLinux::GetRegistersAndSP( if (!fail) { // Accept the first available and do not report errors. for (uptr regs : kExtraRegs) - if (append(regs)) + if (regs && append(regs)) break; } #else _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits