Skip to content

Commit 189b328

Browse files
[MachOWriter] Initialize the values for PtrAuth fields
Initialize some fields in MachOObjectWriter that was moved from ObjectWriter. Fix the UBSAN tests failed for uninitialized variables. (cherry picked from commit 76bb8e2)
1 parent 0e187f0 commit 189b328

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/include/llvm/MC/MCMachObjectWriter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ class MachObjectWriter : public MCObjectWriter {
154154
VersionInfoType VersionInfo{};
155155
VersionInfoType TargetVariantVersionInfo{};
156156

157-
std::optional<unsigned> PtrAuthABIVersion;
158-
bool PtrAuthKernelABIVersion;
157+
std::optional<unsigned> PtrAuthABIVersion = std::nullopt;
158+
bool PtrAuthKernelABIVersion = false;
159159

160160
MachSymbolData *findSymbolData(const MCSymbol &Sym);
161161

0 commit comments

Comments
 (0)