From: Danylo Piliaiev Date: Wed, 2 Sep 2020 10:37:47 +0000 (+0300) Subject: intel/compiler: Fix pointer arithmetic when reading shader assembly X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=87fa645b9438ce7943ae09012f695a7a1bca3eeb;p=mesa.git 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: --- 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;