summaryrefslogtreecommitdiffstats
path: root/llvm/tools/yaml2obj/yaml2macho.cpp
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-06-23 22:36:31 +0000
committerChris Bieneman <beanz@apple.com>2016-06-23 22:36:31 +0000
commit10dcd3bd3b4b688755e9a067ddcf092695953d0f (patch)
tree0e37c915fd63b20558f9e7f763449d3f6689c01a /llvm/tools/yaml2obj/yaml2macho.cpp
parentc17cb815ac9ff5ff0bd339d5bdf8fd0a492aa8b4 (diff)
downloadbcm5719-llvm-10dcd3bd3b4b688755e9a067ddcf092695953d0f.tar.gz
bcm5719-llvm-10dcd3bd3b4b688755e9a067ddcf092695953d0f.zip
[yaml2macho] Removing asserts in favor of explicit yaml parse error
32-bit Mach headers don't have reserved fields. When generating the mapping for 32-bit headers leaving off the reserved field will result in parse errors if the field is present in the yaml. Added a CHECK-NOT line to ensure that mach_header.yaml isn't adding a reserved field, and a test to ensure that the parser error gets hit with 32-bit headers. llvm-svn: 273623
Diffstat (limited to 'llvm/tools/yaml2obj/yaml2macho.cpp')
-rw-r--r--llvm/tools/yaml2obj/yaml2macho.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/llvm/tools/yaml2obj/yaml2macho.cpp b/llvm/tools/yaml2obj/yaml2macho.cpp
index 510f7609b75..7821e63cf88 100644
--- a/llvm/tools/yaml2obj/yaml2macho.cpp
+++ b/llvm/tools/yaml2obj/yaml2macho.cpp
@@ -32,10 +32,6 @@ public:
is64Bit = Obj.Header.magic == MachO::MH_MAGIC_64 ||
Obj.Header.magic == MachO::MH_CIGAM_64;
memset(reinterpret_cast<void *>(&Header), 0, sizeof(MachO::mach_header_64));
- assert((is64Bit || Obj.Header.reserved == 0xDEADBEEFu) &&
- "32-bit MachO has reserved in header");
- assert((!is64Bit || Obj.Header.reserved != 0xDEADBEEFu) &&
- "64-bit MachO has missing reserved in header");
}
Error writeMachO(raw_ostream &OS);
OpenPOWER on IntegriCloud