aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-objdump/MachODump.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2016-11-04 07:10:24 +0000
committerChandler Carruth <chandlerc@gmail.com>2016-11-04 07:10:24 +0000
commit33e58901db5d1a1fc8e3b7d99710f96634e3ae92 (patch)
treec3df56f701303a0f0b33f0638eb0768228050232 /llvm/tools/llvm-objdump/MachODump.cpp
parentd9ef4b6601bec251c48e7d7613042f9a4c62582b (diff)
downloadllvm-33e58901db5d1a1fc8e3b7d99710f96634e3ae92.zip
llvm-33e58901db5d1a1fc8e3b7d99710f96634e3ae92.tar.gz
llvm-33e58901db5d1a1fc8e3b7d99710f96634e3ae92.tar.bz2
Remove dead code trying to handle when the amount of data read is
insufficient to populate the expected struct. Prior to this we already bailed out of the routine when this situation comes up, so none of this code had any effect. If someone wants to bring it back to handle these cases, fixing the earlier conditions and adding the necessary test cases that actually exercises it, they can always revert this and go from there. Both of these were noticed by PVS-Studio due to the identical (dead) condition. llvm-svn: 285989
Diffstat (limited to 'llvm/tools/llvm-objdump/MachODump.cpp')
-rw-r--r--llvm/tools/llvm-objdump/MachODump.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp
index 4ef6f28..67ce0d5 100644
--- a/llvm/tools/llvm-objdump/MachODump.cpp
+++ b/llvm/tools/llvm-objdump/MachODump.cpp
@@ -4405,12 +4405,7 @@ static bool print_class_ro64_t(uint64_t p, struct DisassembleInfo *info,
r = get_pointer_64(p, offset, left, S, info);
if (r == nullptr || left < sizeof(struct class_ro64_t))
return false;
- memset(&cro, '\0', sizeof(struct class_ro64_t));
- if (left < sizeof(struct class_ro64_t)) {
- memcpy(&cro, r, left);
- outs() << " (class_ro_t entends past the end of the section)\n";
- } else
- memcpy(&cro, r, sizeof(struct class_ro64_t));
+ memcpy(&cro, r, sizeof(struct class_ro64_t));
if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
swapStruct(cro);
outs() << " flags " << format("0x%" PRIx32, cro.flags);
@@ -4607,12 +4602,7 @@ static void print_class64_t(uint64_t p, struct DisassembleInfo *info) {
r = get_pointer_64(p, offset, left, S, info);
if (r == nullptr || left < sizeof(struct class64_t))
return;
- memset(&c, '\0', sizeof(struct class64_t));
- if (left < sizeof(struct class64_t)) {
- memcpy(&c, r, left);
- outs() << " (class_t entends past the end of the section)\n";
- } else
- memcpy(&c, r, sizeof(struct class64_t));
+ memcpy(&c, r, sizeof(struct class64_t));
if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
swapStruct(c);