From: Eric Anholt Date: Wed, 21 Feb 2018 04:28:09 +0000 (-0800) Subject: spirv: Silence compiler warning about undefined srcs[0] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=191bc7ce61660c1a4b8de97fe276c75fdc9d464f;p=mesa.git spirv: Silence compiler warning about undefined srcs[0] v2: Use assume() at the srcs[] definition instead. Reviewed-by: Ian Romanick --- diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index 6a358c59731..3de45c47371 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -2925,6 +2925,7 @@ vtn_handle_composite(struct vtn_builder *b, SpvOp opcode, case SpvOpCompositeConstruct: { unsigned elems = count - 3; + assume(elems >= 1); if (glsl_type_is_vector_or_scalar(type)) { nir_ssa_def *srcs[4]; for (unsigned i = 0; i < elems; i++)