diff options
author | Dave Airlie <airlied@redhat.com> | 2020-06-19 17:11:39 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2020-07-27 13:48:11 +1000 |
commit | e5444da729e3c84ab22dcda11dcd2ba5c6c197fc (patch) | |
tree | 93ccf84ac63615cf83dfd279ec544d60ce9727e8 | |
parent | eb5214fc0d033cca16dfd62aca35bbb20e51af19 (diff) |
rtasm: fix undefined unaligned access
-rw-r--r-- | src/gallium/auxiliary/rtasm/rtasm_x86sse.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/rtasm/rtasm_x86sse.c b/src/gallium/auxiliary/rtasm/rtasm_x86sse.c index ad687f32853..16154ca1ca1 100644 --- a/src/gallium/auxiliary/rtasm/rtasm_x86sse.c +++ b/src/gallium/auxiliary/rtasm/rtasm_x86sse.c @@ -195,7 +195,7 @@ static void emit_1b( struct x86_function *p, char b0 ) static void emit_1i( struct x86_function *p, int i0 ) { int *icsr = (int *)reserve(p, sizeof(i0)); - *icsr = i0; + memcpy(icsr, &i0, 4); } static void emit_1ub( struct x86_function *p, unsigned char b0 ) @@ -434,7 +434,8 @@ int x86_call_forward( struct x86_function *p) void x86_fixup_fwd_jump( struct x86_function *p, int fixup ) { - *(int *)(p->store + fixup - 4) = x86_get_label(p) - fixup; + int res = x86_get_label(p) - fixup; + memcpy(p->store + fixup - 4, &res, 4); } void x86_jmp( struct x86_function *p, int label) |