diff options
author | Iago Toral Quiroga <[email protected]> | 2015-10-09 07:57:19 +0200 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2015-10-12 08:30:57 +0200 |
commit | 8281a7c5333d9b78aabf9ce3e9cc7077ccca9413 (patch) | |
tree | fc44f120f4624e624924e080ad953a3155f97013 /src/glsl | |
parent | bcfaab38858fdcfbd8ffeaf6b0e3da8a726f02e6 (diff) |
i965: Fix unsafe pointer when dumping VS/FS IR
For the VS and FS stages that use ARB_vertex_program or
ARB_fragment_program we don't have a shader program, however,
when debuging is enabled, we call brw_dump_ir like this:
brw_dump_ir("vertex", prog, &vs->base, &vp->program.Base);
where vs will be NULL (since prog is NULL).
As pointed out by Chris, this &vs->base is not really a dereference,
it simply computes a new address that just happens to be 0x0 because
the offset of base in brw_shader is 0. Then brw_dump_ir will see a
NULL pointer and not do anything. This is why this does not crash at
the moment. However, this does not look very safe (it would crash
for any location of base that is not the first in brw_shader), so
patch it to prevent a potential (even if unlikely) problem in the
future.
Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/glsl')
0 files changed, 0 insertions, 0 deletions