From: Alyssa Rosenzweig Date: Tue, 30 Apr 2019 05:06:18 +0000 (+0000) Subject: panfrost/midgard: Fix crash on unknown op X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9559280fc30f46cd2fd675f8e84b26925d205813;p=mesa.git panfrost/midgard: Fix crash on unknown op Signed-off-by: Alyssa Rosenzweig --- 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'); }