mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
jay: Make lower_immediates bail if there are no sources
For example, JAY_OPCODE_PRELOAD has no sources. Reading src[other] would read uninitialized data. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40960>
This commit is contained in:
parent
a79931421c
commit
8bfb139033
1 changed files with 3 additions and 0 deletions
|
|
@ -143,6 +143,9 @@ try_swap_src01(jay_inst *I)
|
|||
static void
|
||||
lower_immediates(jay_builder *b, jay_inst *I, struct hash_table_u64 *constants)
|
||||
{
|
||||
if (I->num_srcs == 0)
|
||||
return;
|
||||
|
||||
/* Canonicalize compare-with-zero to increase freedom */
|
||||
if (I->op == JAY_OPCODE_CMP &&
|
||||
jay_is_zero(I->src[1]) &&
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue