From acc2f7fd4ce9be297f2ab9917bcef0eaa4caed22 Mon Sep 17 00:00:00 2001 From: Karsten Wiese Date: Mon, 21 Oct 2024 20:52:13 +0200 Subject: [PATCH] Default initialize all of clang::Stmt's bitfields Before only the first eight bits were set. Fixes issue 104. --- clang/include/clang/AST/Stmt.h | 1 + 1 file changed, 1 insertion(+) diff --git a/clang/include/clang/AST/Stmt.h b/clang/include/clang/AST/Stmt.h index 4b2a7799e4c82e..da2e7d721aad4f 100644 --- a/clang/include/clang/AST/Stmt.h +++ b/clang/include/clang/AST/Stmt.h @@ -1388,6 +1388,7 @@ class alignas(void *) Stmt { "changing bitfields changed sizeof(Stmt)"); static_assert(sizeof(*this) % alignof(void *) == 0, "Insufficient alignment!"); + memset(this, 0, sizeof(*this)); StmtBits.sClass = SC; if (StatisticsEnabled) Stmt::addStmtClass(SC); }