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>
This commit is contained in:
Icecream95
2021-01-01 01:44:04 +13:00
committed by Marge Bot
parent e5e8a628c2
commit b7f2619798

View File

@@ -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)