From: Alyssa Rosenzweig Date: Thu, 6 Jun 2019 15:15:23 +0000 (-0700) Subject: panfrost/midgard: Fix crash with unused SSA values X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=30adeb7a5358d611e01829b000bab6dfee4abed0;p=mesa.git panfrost/midgard: Fix crash with unused SSA values Crash introduced in "b38dab101ca7e0896255dccbd85fd510c47d84d1" but not adding a Fixes tag since it's our bug anyway. Signed-off-by: Alyssa Rosenzweig --- diff --git a/src/gallium/drivers/panfrost/midgard/midgard_compile.c b/src/gallium/drivers/panfrost/midgard/midgard_compile.c index dd86e8bceee..032f4a91196 100644 --- a/src/gallium/drivers/panfrost/midgard/midgard_compile.c +++ b/src/gallium/drivers/panfrost/midgard/midgard_compile.c @@ -1688,6 +1688,10 @@ embedded_to_inline_constant(compiler_context *ctx) static void map_ssa_to_alias(compiler_context *ctx, int *ref) { + /* Sign is used quite deliberately for unused */ + if (*ref < 0) + return; + unsigned int alias = (uintptr_t) _mesa_hash_table_u64_search(ctx->ssa_to_alias, *ref + 1); if (alias) {