Skip to content

Commit 03358be

Browse files
committed
[NFC][Lsan] Fix zero-sized array compilation error
1 parent 27f3454 commit 03358be

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

clang/lib/Tooling/Syntax/Synthesis.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ syntax::Tree *allocateTree(syntax::Arena &A, syntax::NodeKind Kind) {
5858
switch (Kind) {
5959
case syntax::NodeKind::Leaf:
6060
assert(false);
61+
break;
6162
case syntax::NodeKind::TranslationUnit:
6263
return new (A.getAllocator()) syntax::TranslationUnit;
6364
case syntax::NodeKind::UnknownExpression:

compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -504,13 +504,13 @@ typedef struct user regs_struct;
504504
#elif defined(__aarch64__)
505505
typedef struct user_pt_regs regs_struct;
506506
#define REG_SP sp
507-
static constexpr uptr kExtraRegs[] = {};
507+
static constexpr uptr kExtraRegs[] = {0};
508508
#define ARCH_IOVEC_FOR_GETREGSET
509509

510510
#elif defined(__s390__)
511511
typedef _user_regs_struct regs_struct;
512512
#define REG_SP gprs[15]
513-
static constexpr uptr kExtraRegs[] = {};
513+
static constexpr uptr kExtraRegs[] = {0};
514514
#define ARCH_IOVEC_FOR_GETREGSET
515515

516516
#else
@@ -578,7 +578,7 @@ PtraceRegistersStatus SuspendedThreadsListLinux::GetRegistersAndSP(
578578
if (!fail) {
579579
// Accept the first available and do not report errors.
580580
for (uptr regs : kExtraRegs)
581-
if (append(regs))
581+
if (regs && append(regs))
582582
break;
583583
}
584584
#else

0 commit comments

Comments
 (0)