Skip to content

Commit 992a749

Browse files
Fix removing UB for ResInstSize initialisation
1 parent e0ea633 commit 992a749

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/utils/TableGen/AsmMatcherEmitter.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -564,9 +564,9 @@ struct MatchableInfo {
564564
// where it was copied while being in an owning state.
565565
MatchableInfo(const MatchableInfo &RHS)
566566
: AsmVariantID(RHS.AsmVariantID), AsmString(RHS.AsmString),
567-
TheDef(RHS.TheDef), DefRec(RHS.DefRec), ResOperands(RHS.ResOperands),
568-
Mnemonic(RHS.Mnemonic), AsmOperands(RHS.AsmOperands),
569-
RequiredFeatures(RHS.RequiredFeatures),
567+
TheDef(RHS.TheDef), ResInstSize(RHS.ResInstSize), DefRec(RHS.DefRec),
568+
ResOperands(RHS.ResOperands), Mnemonic(RHS.Mnemonic),
569+
AsmOperands(RHS.AsmOperands), RequiredFeatures(RHS.RequiredFeatures),
570570
ConversionFnKind(RHS.ConversionFnKind),
571571
HasDeprecation(RHS.HasDeprecation),
572572
UseInstAsmMatchConverter(RHS.UseInstAsmMatchConverter) {
@@ -678,7 +678,7 @@ struct MatchableInfo {
678678
return false;
679679

680680
// The size of instruction is unambiguous.
681-
if (Target.getPreferSmallerInstructions() && ResInstSize != RHS.ResInstSize)
681+
if (getPreferSmallerInstructions(Target) && ResInstSize != RHS.ResInstSize)
682682
return false;
683683

684684
// The number of operands is unambiguous.

0 commit comments

Comments
 (0)