summaryrefslogtreecommitdiff
path: root/include/llvm/Support
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2014-03-05 00:32:34 +0000
committerRui Ueyama <ruiu@google.com>2014-03-05 00:32:34 +0000
commite553a3ba42072f820e4eb9285189924dd3c1814f (patch)
tree6d6225806dbd65c866bbf04cec5f164ff9230a8d /include/llvm/Support
parent34fae3adef064533271387aed32b2b1ccfa6d6cf (diff)
downloadllvm-e553a3ba42072f820e4eb9285189924dd3c1814f.tar.gz
llvm-e553a3ba42072f820e4eb9285189924dd3c1814f.tar.bz2
llvm-e553a3ba42072f820e4eb9285189924dd3c1814f.tar.xz
Fix endianness bug.
Looks like llvm-readobj is the only customer of this code, and apparently there's no test to cover this function. I'll write it after finishing plumbing from llvm-objdump to there. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202915 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support')
-rw-r--r--include/llvm/Support/Win64EH.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/llvm/Support/Win64EH.h b/include/llvm/Support/Win64EH.h
index ecce713680..8966c0d04e 100644
--- a/include/llvm/Support/Win64EH.h
+++ b/include/llvm/Support/Win64EH.h
@@ -108,17 +108,20 @@ struct UnwindInfo {
/// \brief Return pointer to language specific data part of UnwindInfo.
const void *getLanguageSpecificData() const {
- return reinterpret_cast<const void *>(&UnwindCodes[(NumCodes+1) & ~1]);
+ return reinterpret_cast<const support::ulittle32_t *>(
+ &UnwindCodes[(NumCodes + 1) & ~1]);
}
/// \brief Return image-relative offset of language-specific exception handler.
uint32_t getLanguageSpecificHandlerOffset() const {
- return *reinterpret_cast<const uint32_t *>(getLanguageSpecificData());
+ return *reinterpret_cast<const support::ulittle32_t *>(
+ getLanguageSpecificData());
}
/// \brief Set image-relative offset of language-specific exception handler.
void setLanguageSpecificHandlerOffset(uint32_t offset) {
- *reinterpret_cast<uint32_t *>(getLanguageSpecificData()) = offset;
+ *reinterpret_cast<support::ulittle32_t *>(getLanguageSpecificData()) =
+ offset;
}
/// \brief Return pointer to exception-specific data.