zink: fix off-by-one in assert
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 24 Jun 2019 16:23:13 +0000 (18:23 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 28 Oct 2019 08:51:45 +0000 (08:51 +0000)
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
src/gallium/drivers/zink/nir_to_spirv/spirv_builder.c

index 8028b7a6d706af8ce459943b964b1168483a8128..32c4bdc73ca08cc9d3045477a31991f6ffd657b9 100644 (file)
@@ -650,7 +650,7 @@ get_type_def(struct spirv_builder *b, SpvOp op, const uint32_t args[],
     */
 
    struct spirv_type key;
-   assert(num_args < ARRAY_SIZE(key.args));
+   assert(num_args <= ARRAY_SIZE(key.args));
    key.op = op;
    memcpy(&key.args, args, sizeof(uint32_t) * num_args);
    key.num_args = num_args;