summaryrefslogtreecommitdiff
path: root/src/panfrost/midgard
diff options
context:
space:
mode:
authorIcecream95 <ixn@disroot.org>2021-01-01 01:44:04 +1300
committerMarge Bot <eric+marge@anholt.net>2021-01-01 02:58:49 +0000
commitb7f2619798ae2867c8ee22593130d86c2c8525ea (patch)
tree72b4c370a5d4c681333b2070c1f9a99acccb7130 /src/panfrost/midgard
parente5e8a628c20901822ccdd6d317baf8605c0c0204 (diff)
pan/mdg: Return false instead of asserting in mir_args_ssa
mir_args_ssa asserted that the given number of arguments to use is greater than or equal to the actual number, but this is not checked by callers, so instead of crashing return false to mark failure. Fixes the local memory atomics OpenCL tests in Piglit. Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8264>
Diffstat (limited to 'src/panfrost/midgard')
-rw-r--r--src/panfrost/midgard/midgard_address.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/panfrost/midgard/midgard_address.c b/src/panfrost/midgard/midgard_address.c
index 22411c3606e..310d7927360 100644
--- a/src/panfrost/midgard/midgard_address.c
+++ b/src/panfrost/midgard/midgard_address.c
@@ -55,7 +55,9 @@ static bool
mir_args_ssa(nir_ssa_scalar s, unsigned count)
{
nir_alu_instr *alu = nir_instr_as_alu(s.def->parent_instr);
- assert(count <= nir_op_infos[alu->op].num_inputs);
+
+ if (count > nir_op_infos[alu->op].num_inputs)
+ return false;
for (unsigned i = 0; i < count; ++i) {
if (!alu->src[i].src.is_ssa)