A filed of nir_variable.location may be equel to -1. That may cause copying to invalid address of list-node, making some internal fields corrupted.
Patch fixes segfault during freeing context due to corrupted address of ralloc_header.destructor.
CC: Caio Marcelo de Oliveira Filho caio.oliveira@intel.com Fixes: b6d47535 (nir/large_constants: De-duplicate constants) Signed-off-by: Sergii Romantsov sergii.romantsov@globallogic.com Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111676