diff options
author | ludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2005-11-01 19:59:14 +0000 |
---|---|---|
committer | ludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2005-11-01 19:59:14 +0000 |
commit | a6d8e02bc4e17a5b68d3d2f2287f6d7015bccc4d (patch) | |
tree | b03659b96a492ba35cb55401ccc1720e162b3529 /code/qcommon | |
parent | 6678152ca8091c8ef07deb0e0c46e38cf9ee149e (diff) | |
download | ioquake3-aero-a6d8e02bc4e17a5b68d3d2f2287f6d7015bccc4d.tar.gz ioquake3-aero-a6d8e02bc4e17a5b68d3d2f2287f6d7015bccc4d.zip |
use memcpy to fix use of misaligned data
git-svn-id: svn://svn.icculus.org/quake3/trunk@208 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/qcommon')
-rw-r--r-- | code/qcommon/vm_interpreted.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/code/qcommon/vm_interpreted.c b/code/qcommon/vm_interpreted.c index 6aca00e..4359125 100644 --- a/code/qcommon/vm_interpreted.c +++ b/code/qcommon/vm_interpreted.c @@ -124,7 +124,11 @@ static char *opnames[256] = { #define loadWord(addr) __lwbrx(addr,0) #endif #else - #define loadWord(addr) LittleLong(*((int *)addr)) + static inline int loadWord(void *addr) { + int word; + memcpy(&word, addr, 4); + return LittleLong(word); + } #endif char *VM_Indent( vm_t *vm ) { |