aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_deref.c
diff options
context:
space:
mode:
authorConnor Abbott <[email protected]>2019-07-30 11:04:14 +0200
committerConnor Abbott <[email protected]>2019-07-30 17:14:28 +0200
commit7788992bc6864a072c824e16b666acad1e0786c8 (patch)
treed8e556fce65f9013c49989505c2ec23c90f8fff5 /src/compiler/nir/nir_deref.c
parent9d7ead6f9bc8d13126127b17302d927b1f74cdbe (diff)
nir: Fix comparison for nir_deref_instr_is_known_out_of_bounds()
There was an off-by-one error. Fixes: 156306e5e62 ("nir/find_array_copies: Handle wildcards and overlapping copies") Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_deref.c')
-rw-r--r--src/compiler/nir/nir_deref.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/nir/nir_deref.c b/src/compiler/nir/nir_deref.c
index 804ec99fa71..5aa1c383db7 100644
--- a/src/compiler/nir/nir_deref.c
+++ b/src/compiler/nir/nir_deref.c
@@ -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;
}