Skip to content

Commit 5a285bd

Browse files
authored
[LLVM][TableGen] Read from uninitialised variable (#66889)
Fixing an issue found in a UBsan build. When defining a variable-length encoding with no operands or slices, the HasDynamicSegment member was read without being initialised.
1 parent 45f51f9 commit 5a285bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/utils/TableGen/VarLenCodeEmitterGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static std::pair<StringRef, StringRef> getCustomCoders(ArrayRef<Init *> Args) {
114114
}
115115

116116
VarLenInst::VarLenInst(const DagInit *DI, const RecordVal *TheDef)
117-
: TheDef(TheDef), NumBits(0U) {
117+
: TheDef(TheDef), NumBits(0U), HasDynamicSegment(false) {
118118
buildRec(DI);
119119
for (const auto &S : Segments)
120120
NumBits += S.BitWidth;

0 commit comments

Comments
 (0)