[Mesa-dev] [PATCH] intel/eu: Use a struct copy instead of a memcpy

Jason Ekstrand jason at jlekstrand.net
Tue Jun 5 21:34:17 UTC 2018


The memcpy had the wrong size and this was causing crashes on 32-bit
builds of the driver.

Fixes: 6a9525bf6729a8 "intel/eu: Switch to a logical state stack"
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106830
---
 src/intel/compiler/brw_eu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/intel/compiler/brw_eu.c b/src/intel/compiler/brw_eu.c
index d0e4ea20704..6ef0a6a577c 100644
--- a/src/intel/compiler/brw_eu.c
+++ b/src/intel/compiler/brw_eu.c
@@ -289,7 +289,7 @@ void brw_set_default_acc_write_control(struct brw_codegen *p, unsigned value)
 void brw_push_insn_state( struct brw_codegen *p )
 {
    assert(p->current != &p->stack[BRW_EU_MAX_INSN_STACK-1]);
-   memcpy(p->current + 1, p->current, sizeof(brw_inst));
+   *(p->current + 1) = *p->current;
    p->current++;
 }
 
-- 
2.17.1



More information about the mesa-dev mailing list