<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jun 1, 2018 at 1:34 PM, Rob Clark <span dir="ltr"><<a href="mailto:robdclark@gmail.com" target="_blank">robdclark@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, Jun 1, 2018 at 3:39 PM, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
> If something uses get_variable, it's likely that it doesn't know what to<br>
> do with casts. If there are any casts in the chain, just return NULL.<br>
> ---<br>
> src/compiler/nir/nir.h | 6 +++++-<br>
> 1 file changed, 5 insertions(+), 1 deletion(-)<br>
><br>
> diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h<br>
> index 8b826d8..28a40c7 100644<br>
> --- a/src/compiler/nir/nir.h<br>
> +++ b/src/compiler/nir/nir.h<br>
> @@ -1015,8 +1015,12 @@ nir_deref_instr_parent(const nir_deref_instr *instr)<br>
> static inline nir_variable *<br>
> nir_deref_instr_get_variable(<wbr>const nir_deref_instr *instr)<br>
> {<br>
> - while (instr->deref_type != nir_deref_type_var)<br>
> + while (instr->deref_type != nir_deref_type_var) {<br>
> + if (!instr || instr->deref_type == nir_deref_type_cast)<br>
<br>
</span>the "while (instr->foo ...) { if (!instr || ...)" thing looks a bit suspicious..<br>
</blockquote></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">You're right, that is fishy. Let me try again.<br></div></div>