<div dir="ltr">Reviewed-by: Jason Ekstrand <<a href="mailto:jason.ekstrand@intel.com">jason.ekstrand@intel.com</a>><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 23, 2015 at 4:35 PM, Eric Anholt <span dir="ltr"><<a href="mailto:eric@anholt.net" target="_blank">eric@anholt.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
src/glsl/nir/nir_print.c | 22 ++++++++++++++++------<br>
1 file changed, 16 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/src/glsl/nir/nir_print.c b/src/glsl/nir/nir_print.c<br>
index 1a50ae9..2ef55ed 100644<br>
--- a/src/glsl/nir/nir_print.c<br>
+++ b/src/glsl/nir/nir_print.c<br>
@@ -210,7 +210,9 @@ print_var_decl(nir_variable *var, print_var_state *state, FILE *fp)<br>
<br>
glsl_print_type(var->type, fp);<br>
<br>
- struct set_entry *entry = _mesa_set_search(state->syms, var->name);<br>
+ struct set_entry *entry = NULL;<br>
+ if (state)<br>
+ entry = _mesa_set_search(state->syms, var->name);<br>
<br>
char *name;<br>
<br>
@@ -231,18 +233,26 @@ print_var_decl(nir_variable *var, print_var_state *state, FILE *fp)<br>
<br>
fprintf(fp, "\n");<br>
<br>
- _mesa_set_add(state->syms, name);<br>
- _mesa_hash_table_insert(state->ht, var, name);<br>
+ if (state) {<br>
+ _mesa_set_add(state->syms, name);<br>
+ _mesa_hash_table_insert(state->ht, var, name);<br>
+ }<br>
}<br>
<br>
static void<br>
print_var(nir_variable *var, print_var_state *state, FILE *fp)<br>
{<br>
- struct hash_entry *entry = _mesa_hash_table_search(state->ht, var);<br>
+ const char *name;<br>
+ if (state) {<br>
+ struct hash_entry *entry = _mesa_hash_table_search(state->ht, var);<br>
<br>
- assert(entry != NULL);<br>
+ assert(entry != NULL);<br>
+ name = entry->data;<br>
+ } else {<br>
+ name = var->name;<br>
+ }<br>
<br>
- fprintf(fp, "%s", (char *) entry->data);<br>
+ fprintf(fp, "%s", name);<br>
}<br>
<br>
static void<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.1.3<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>