summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ObjectYAML/MachOYAML.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/ObjectYAML/MachOYAML.cpp')
-rw-r--r--llvm/lib/ObjectYAML/MachOYAML.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/ObjectYAML/MachOYAML.cpp b/llvm/lib/ObjectYAML/MachOYAML.cpp
index d13c84eb04f..890bc039956 100644
--- a/llvm/lib/ObjectYAML/MachOYAML.cpp
+++ b/llvm/lib/ObjectYAML/MachOYAML.cpp
@@ -182,8 +182,10 @@ void mapLoadCommandData<MachO::dylinker_command>(
void MappingTraits<MachOYAML::LoadCommand>::mapping(
IO &IO, MachOYAML::LoadCommand &LoadCommand) {
- IO.mapRequired(
- "cmd", (MachO::LoadCommandType &)LoadCommand.Data.load_command_data.cmd);
+ MachO::LoadCommandType TempCmd = static_cast<MachO::LoadCommandType>(
+ LoadCommand.Data.load_command_data.cmd);
+ IO.mapRequired("cmd", TempCmd);
+ LoadCommand.Data.load_command_data.cmd = TempCmd;
IO.mapRequired("cmdsize", LoadCommand.Data.load_command_data.cmdsize);
#define HANDLE_LOAD_COMMAND(LCName, LCValue, LCStruct) \
OpenPOWER on IntegriCloud