Skip to content

Commit d9ed270

Browse files
committed
fix: uninitialized variable causing UB in microsoft layout builder
1 parent b7a0a65 commit d9ed270

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang/lib/AST/RecordLayoutBuilder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2563,7 +2563,8 @@ struct MicrosoftRecordLayoutBuilder {
25632563
typedef llvm::DenseMap<const CXXRecordDecl *, CharUnits> BaseOffsetsMapTy;
25642564
MicrosoftRecordLayoutBuilder(const ASTContext &Context,
25652565
EmptySubobjectMap *EmptySubobjects)
2566-
: Context(Context), EmptySubobjects(EmptySubobjects) {}
2566+
: Context(Context), EmptySubobjects(EmptySubobjects),
2567+
RemainingBitsInField(0) {}
25672568

25682569
private:
25692570
MicrosoftRecordLayoutBuilder(const MicrosoftRecordLayoutBuilder &) = delete;

0 commit comments

Comments
 (0)