intel/compiler: Fix pointer arithmetic when reading shader assembly

start_offset is a byte offset.

Fixes: 04a9951580
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6557>
This commit is contained in:
Danylo Piliaiev
2020-09-02 13:37:47 +03:00
committed by Marge Bot
parent c601e730b2
commit 87fa645b94

View File

@@ -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;