From c93ade93fb98b3eca45ee42ec0638ec055f39e7a Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 21 Aug 2020 16:55:02 -0500 Subject: [PATCH] nir/lower_explicit_io: Assert that compute address sizes match derefs Reviewed-by: Jesse Natalie Part-of: --- src/compiler/nir/nir_lower_io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/nir/nir_lower_io.c b/src/compiler/nir/nir_lower_io.c index 6fb90c6efbd..2cff415eb43 100644 --- a/src/compiler/nir/nir_lower_io.c +++ b/src/compiler/nir/nir_lower_io.c @@ -1376,6 +1376,8 @@ lower_explicit_io_deref(nir_builder *b, nir_deref_instr *deref, nir_ssa_def *addr = nir_explicit_io_address_from_deref(b, deref, base_addr, addr_format); + assert(addr->bit_size == deref->dest.ssa.bit_size); + assert(addr->num_components == deref->dest.ssa.num_components); nir_instr_remove(&deref->instr); nir_ssa_def_rewrite_uses(&deref->dest.ssa, nir_src_for_ssa(addr)); -- 2.30.2