From 48683c91a80fb1186347107aa805fe29a8396e5f Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Tue, 1 Nov 2005 19:59:14 +0000 Subject: [PATCH] use memcpy to fix use of misaligned data --- code/qcommon/vm_interpreted.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/qcommon/vm_interpreted.c b/code/qcommon/vm_interpreted.c index 6aca00e0..43591259 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 ) {