struct deref_node *children[0];
};
+#define UNDEF_NODE ((struct deref_node *)(uintptr_t)1)
+
struct lower_variables_state {
nir_shader *shader;
void *dead_ctx;
* somewhat gracefully.
*/
if (index >= glsl_get_length(parent->type))
- return NULL;
+ return UNDEF_NODE;
if (parent->children[index] == NULL) {
parent->children[index] =
continue;
struct deref_node *node = get_deref_node(deref, state);
- if (node == NULL) {
+ if (node == UNDEF_NODE) {
/* If we hit this path then we are referencing an invalid
* value. Most likely, we unrolled something and are
* reading past the end of some array. In any case, this
assert(intrin->src[1].is_ssa);
nir_ssa_def *value = intrin->src[1].ssa;
- if (node == NULL) {
+ if (node == UNDEF_NODE) {
/* Probably an out-of-bounds array store. That should be a
* no-op. */
nir_instr_remove(&intrin->instr);