summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-04-30 05:06:18 +0000
committerAlyssa Rosenzweig <[email protected]>2019-05-04 19:08:50 +0000
commit9559280fc30f46cd2fd675f8e84b26925d205813 (patch)
treeb9b608f9b474bb641fbf43a502a2062222c0782f
parent96eed4e04b5cf0f0734c5ca9d5308d5342198857 (diff)
panfrost/midgard: Fix crash on unknown op
Signed-off-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r--src/gallium/drivers/panfrost/midgard/helpers.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/drivers/panfrost/midgard/helpers.h b/src/gallium/drivers/panfrost/midgard/helpers.h
index 6d35f4de025..d2855cd89cd 100644
--- a/src/gallium/drivers/panfrost/midgard/helpers.h
+++ b/src/gallium/drivers/panfrost/midgard/helpers.h
@@ -264,6 +264,10 @@ static struct {
static bool
midgard_is_integer_op(int op)
{
- char prefix = alu_opcode_props[op].name[0];
- return (prefix == 'i') || (prefix == 'u');
+ const char *name = alu_opcode_props[op].name;
+
+ if (!name)
+ return false;
+
+ return (name[0] == 'i') || (name[0] == 'u');
}