From 87fa645b9438ce7943ae09012f695a7a1bca3eeb Mon Sep 17 00:00:00 2001 From: Danylo Piliaiev Date: Wed, 2 Sep 2020 13:37:47 +0300 Subject: [PATCH] intel/compiler: Fix pointer arithmetic when reading shader assembly start_offset is a byte offset. Fixes: 04a995158084acbd1917b4c7e0f8d381e1c9222d Signed-off-by: Danylo Piliaiev Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/compiler/brw_eu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/compiler/brw_eu.cpp b/src/intel/compiler/brw_eu.cpp index 0a886b27ae2..51ae8cdc221 100644 --- a/src/intel/compiler/brw_eu.cpp +++ b/src/intel/compiler/brw_eu.cpp @@ -394,7 +394,7 @@ bool brw_try_override_assembly(struct brw_codegen *p, int start_offset, p->store = (brw_inst *)reralloc_size(p->mem_ctx, p->store, p->next_insn_offset); assert(p->store); - ssize_t ret = read(fd, p->store + start_offset, sb.st_size); + ssize_t ret = read(fd, (char *)p->store + start_offset, sb.st_size); close(fd); if (ret != sb.st_size) { return false; -- 2.30.2