diff --git a/.pick_status.json b/.pick_status.json index e5073f0beb2..793209a11a0 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2956,7 +2956,7 @@ "description": "nir/lower_io: fix bounds checking for 64bit_bounded_global", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/compiler/nir/nir_lower_io.c b/src/compiler/nir/nir_lower_io.c index e0347469e8b..423a153e4e2 100644 --- a/src/compiler/nir/nir_lower_io.c +++ b/src/compiler/nir/nir_lower_io.c @@ -1184,8 +1184,9 @@ addr_is_in_bounds(nir_builder *b, nir_ssa_def *addr, { assert(addr_format == nir_address_format_64bit_bounded_global); assert(addr->num_components == 4); - return nir_ige(b, nir_channel(b, addr, 2), - nir_iadd_imm(b, nir_channel(b, addr, 3), size)); + assert(size > 0); + return nir_ult(b, nir_iadd_imm(b, nir_channel(b, addr, 3), size - 1), + nir_channel(b, addr, 2)); } static void