From 8bfb139033de000791725f0aa13b95b6b3ffaf26 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 13 Apr 2026 12:34:26 -0700 Subject: [PATCH] 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: --- src/intel/compiler/jay/jay_lower_pre_ra.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/intel/compiler/jay/jay_lower_pre_ra.c b/src/intel/compiler/jay/jay_lower_pre_ra.c index d71ea7c3711..28e828a3886 100644 --- a/src/intel/compiler/jay/jay_lower_pre_ra.c +++ b/src/intel/compiler/jay/jay_lower_pre_ra.c @@ -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]) &&