From c298f25c4efb71b461ef0a93cdc20c468afc7511 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 2 Jan 2020 13:44:40 -0500 Subject: [PATCH] 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 --- src/panfrost/midgard/midgard_schedule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.30.2