diff options
author | Duncan Sands <baldrick@free.fr> | 2007-11-28 10:36:19 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2007-11-28 10:36:19 +0000 |
commit | 8d00dd05e51353fdbbb079f21ad4322055916e6a (patch) | |
tree | f00398a41015290102bf7016f73043d6e9a8d634 /lib/ExecutionEngine/ExecutionEngine.cpp | |
parent | 95412b3dafb25afe561396702dfdf13be099ef1d (diff) | |
download | external_llvm-8d00dd05e51353fdbbb079f21ad4322055916e6a.tar.gz external_llvm-8d00dd05e51353fdbbb079f21ad4322055916e6a.tar.bz2 external_llvm-8d00dd05e51353fdbbb079f21ad4322055916e6a.zip |
My compiler complains that "x always evaluates to true"
in this call:
Result.IntVal = APInt(80, 2, x);
What is x?
uint16_t x[8];
I deduce that the APInt constructor being used is this one:
APInt(uint32_t numBits, uint64_t val, bool isSigned = false);
rather than this one:
APInt(uint32_t numBits, uint32_t numWords, const uint64_t bigVal[]);
That doesn't seem right! This fix compiles but is otherwise completely
untested.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44400 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r-- | lib/ExecutionEngine/ExecutionEngine.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp index 72db4e4360..cc3cc38305 100644 --- a/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/lib/ExecutionEngine/ExecutionEngine.cpp @@ -712,13 +712,17 @@ void ExecutionEngine::LoadValueFromMemory(GenericValue &Result, break; case Type::X86_FP80TyID: { // This is endian dependent, but it will only work on x86 anyway. - uint16_t x[8], *p = (uint16_t*)Ptr; + uint16_t *p = (uint16_t*)Ptr; + union { + uint16_t x[8]; + uint64_t y[2]; + }; x[0] = p[1]; x[1] = p[2]; x[2] = p[3]; x[3] = p[4]; x[4] = p[0]; - Result.IntVal = APInt(80, 2, x); + Result.IntVal = APInt(80, 2, y); break; } default: |