Skip to content

Commit

Permalink
Default initialize all of clang::Stmt's bitfields
Browse files Browse the repository at this point in the history
Before only the first eight bits were set.

Fixes issue 104.
  • Loading branch information
fzuuzf authored and Karsten Wiese committed Oct 21, 2024
1 parent bf9669e commit acc2f7f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions clang/include/clang/AST/Stmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit acc2f7f

Please sign in to comment.