summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2018-02-20 20:28:09 -0800
committerEric Anholt <eric@anholt.net>2018-03-13 10:32:55 -0700
commit191bc7ce61660c1a4b8de97fe276c75fdc9d464f (patch)
tree642b3dc0d0f7ea1b0eb04d76bfaa04b6fc1dd96a
parent7c834306724881a859f7ac2a48ad71fd8b882765 (diff)
spirv: Silence compiler warning about undefined srcs[0]
v2: Use assume() at the srcs[] definition instead. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
-rw-r--r--src/compiler/spirv/spirv_to_nir.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 6a358c5973..3de45c4737 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++)