mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
pan/midgard: Allow NULL argument in mir_has_arg
It's sometimes convenient to call this with no instruction specified. By definition, a missing instruction cannot reference any argument, so let's check for NULL and shortciruit to false. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
This commit is contained in:
parent
bcc59ff04d
commit
72cbd2d4e7
1 changed files with 3 additions and 0 deletions
|
|
@ -566,6 +566,9 @@ v_mov(unsigned src, midgard_vector_alu_src mod, unsigned dest)
|
||||||
static inline bool
|
static inline bool
|
||||||
mir_has_arg(midgard_instruction *ins, unsigned arg)
|
mir_has_arg(midgard_instruction *ins, unsigned arg)
|
||||||
{
|
{
|
||||||
|
if (!ins)
|
||||||
|
return false;
|
||||||
|
|
||||||
for (unsigned i = 0; i < ARRAY_SIZE(ins->src); ++i) {
|
for (unsigned i = 0; i < ARRAY_SIZE(ins->src); ++i) {
|
||||||
if (ins->src[i] == arg)
|
if (ins->src[i] == arg)
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue