nir: Initialize nir_ssa_def::live_index
authorJason Ekstrand <jason@jlekstrand.net>
Fri, 31 Jul 2020 15:36:35 +0000 (10:36 -0500)
committerMarge Bot <eric+marge@anholt.net>
Wed, 19 Aug 2020 19:43:31 +0000 (19:43 +0000)
Previously, this was left uninitialized.  Let's initialize it to an
obviously bogus value so we notice if anyone ever tries to use stale
liveness data.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6210>

src/compiler/nir/nir.c

index d8ff265d9f3f8440e7033dd4fa6c714d8be0152f..2fe9c6e295cce65b9a4bde2a2652da74ef5a1284 100644 (file)
@@ -1489,6 +1489,7 @@ nir_ssa_def_init(nir_instr *instr, nir_ssa_def *def,
                  unsigned bit_size, const char *name)
 {
    def->name = ralloc_strdup(instr, name);
+   def->live_index = UINT_MAX; /* Something clearly OOB */
    def->parent_instr = instr;
    list_inithead(&def->uses);
    list_inithead(&def->if_uses);