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:

committed by
Marge Bot

parent
c601e730b2
commit
87fa645b94
@@ -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;
|
||||
|
Reference in New Issue
Block a user