From: Alyssa Rosenzweig Date: Thu, 2 Jan 2020 18:44:40 +0000 (-0500) Subject: pan/midgard: Fix memory corruption in constant combining X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c298f25c4efb71b461ef0a93cdc20c468afc7511;p=mesa.git pan/midgard: Fix memory corruption in constant combining It's a long story... but we'd try to insert constants that weren't there and end up clobbering fields in the bundle following the constant array... Signed-off-by: Alyssa Rosenzweig --- diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c index d4239157ead..a78bb901b43 100644 --- a/src/panfrost/midgard/midgard_schedule.c +++ b/src/panfrost/midgard/midgard_schedule.c @@ -415,7 +415,7 @@ mir_adjust_constants(midgard_instruction *ins, /* If the constant is new, check ourselves */ for (unsigned j = 0; j < i; ++j) { - if (constants[j] == constants[i]) { + if (constants[j] == constants[i] && (mask & (1 << j))) { ok = true; break; }