aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-02-03 14:32:22 -0500
committerTomeu Vizoso <[email protected]>2020-02-04 08:24:33 +0100
commit0f3eb7989b38239d08d729a488ad6b737ec61ad8 (patch)
treef5f325b44dc5ce35f13eccc5cb4e36a754a902d6 /src
parent8ec4028d4057da19708b4f4bce88ee16f96f322a (diff)
pan/midgard: Check for null consts
Valid shaders shouldn't hit this, but Coverity doesn't know that. CID 1458029: (FORWARD_NULL) Passing null pointer "consts" to "print_scalar_field", which dereferences it. Tomeu: Fix name of variable Signed-off-by: Alyssa Rosenzweig <[email protected]> Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3684>
Diffstat (limited to 'src')
-rw-r--r--src/panfrost/midgard/disassemble.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/panfrost/midgard/disassemble.c b/src/panfrost/midgard/disassemble.c
index 9ef184b8bce..a0640d66e8c 100644
--- a/src/panfrost/midgard/disassemble.c
+++ b/src/panfrost/midgard/disassemble.c
@@ -337,6 +337,8 @@ print_scalar_constant(FILE *fp, unsigned src_binary,
midgard_scalar_alu_src *src = (midgard_scalar_alu_src *)&src_binary;
unsigned mod = 0;
+ assert(consts != NULL);
+
if (!midgard_is_integer_op(alu->op)) {
if (src->abs)
mod |= MIDGARD_FLOAT_MOD_ABS;