aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-06-05 22:59:21 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-06-05 22:59:21 +0000
commit6ffb6a72a0503fa349f469f84732e98820c21eda (patch)
tree5992b4b55b47749ed375ff5b3805a9e9cc175be2 /lib
parent67e46719564d911aaeec5b9aa42b31165ab3080e (diff)
downloadexternal_llvm-6ffb6a72a0503fa349f469f84732e98820c21eda.zip
external_llvm-6ffb6a72a0503fa349f469f84732e98820c21eda.tar.gz
external_llvm-6ffb6a72a0503fa349f469f84732e98820c21eda.tar.bz2
Don't break strict aliasing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52026 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/X86/X86JITInfo.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Target/X86/X86JITInfo.cpp b/lib/Target/X86/X86JITInfo.cpp
index 0ca93d9..9aff83a 100644
--- a/lib/Target/X86/X86JITInfo.cpp
+++ b/lib/Target/X86/X86JITInfo.cpp
@@ -396,8 +396,8 @@ void *X86JITInfo::emitGlobalValueLazyPtr(const GlobalValue* GV, void *ptr,
MachineCodeEmitter &MCE) {
#if defined (X86_64_JIT)
MCE.startFunctionStub(GV, 8, 8);
- MCE.emitWordLE(((unsigned *)&ptr)[0]);
- MCE.emitWordLE(((unsigned *)&ptr)[1]);
+ MCE.emitWordLE((unsigned)(intptr_t)ptr);
+ MCE.emitWordLE((unsigned)(((intptr_t)ptr) >> 32));
#else
MCE.startFunctionStub(GV, 4, 4);
MCE.emitWordLE((intptr_t)ptr);
@@ -420,8 +420,8 @@ void *X86JITInfo::emitFunctionStub(const Function* F, void *Fn,
MCE.startFunctionStub(F, 13, 4);
MCE.emitByte(0x49); // REX prefix
MCE.emitByte(0xB8+2); // movabsq r10
- MCE.emitWordLE(((unsigned *)&Fn)[0]);
- MCE.emitWordLE(((unsigned *)&Fn)[1]);
+ MCE.emitWordLE((unsigned)(intptr_t)Fn);
+ MCE.emitWordLE((unsigned)(((intptr_t)Fn) >> 32));
MCE.emitByte(0x41); // REX prefix
MCE.emitByte(0xFF); // jmpq *r10
MCE.emitByte(2 | (4 << 3) | (3 << 6));
@@ -437,8 +437,8 @@ void *X86JITInfo::emitFunctionStub(const Function* F, void *Fn,
MCE.startFunctionStub(F, 14, 4);
MCE.emitByte(0x49); // REX prefix
MCE.emitByte(0xB8+2); // movabsq r10
- MCE.emitWordLE(((unsigned *)&Fn)[0]);
- MCE.emitWordLE(((unsigned *)&Fn)[1]);
+ MCE.emitWordLE((unsigned)(intptr_t)Fn);
+ MCE.emitWordLE((unsigned)(((intptr_t)Fn) >> 32));
MCE.emitByte(0x41); // REX prefix
MCE.emitByte(0xFF); // callq *r10
MCE.emitByte(2 | (2 << 3) | (3 << 6));