nir: Fix comparison for nir_deref_instr_is_known_out_of_bounds()
authorConnor Abbott <cwabbott0@gmail.com>
Tue, 30 Jul 2019 09:04:14 +0000 (11:04 +0200)
committerConnor Abbott <cwabbott0@gmail.com>
Tue, 30 Jul 2019 15:14:28 +0000 (17:14 +0200)
There was an off-by-one error.

Fixes: 156306e5e62 ("nir/find_array_copies: Handle wildcards and overlapping copies")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir_deref.c

index 804ec99fa715caae7b50c2d15c929d9623b74b5f..5aa1c383db701125f53c91bcbd2d6efdac3836d7 100644 (file)
@@ -127,7 +127,7 @@ nir_deref_instr_is_known_out_of_bounds(nir_deref_instr *instr)
    for (; instr; instr = nir_deref_instr_parent(instr)) {
       if (instr->deref_type == nir_deref_type_array &&
           nir_src_is_const(instr->arr.index) &&
-           nir_src_as_uint(instr->arr.index) >
+           nir_src_as_uint(instr->arr.index) >=
            glsl_get_length(nir_deref_instr_parent(instr)->type))
          return true;
    }