On Monday, January 26, 2015 11:07:51 AM Juha-Pekka Heikkila wrote: > report error on null return value and bail out. > > Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikk...@gmail.com> > --- > src/glsl/nir/nir_print.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/src/glsl/nir/nir_print.c b/src/glsl/nir/nir_print.c > index 9c07950..79c4cd8 100644 > --- a/src/glsl/nir/nir_print.c > +++ b/src/glsl/nir/nir_print.c > @@ -646,6 +646,11 @@ print_block(nir_block *block, print_var_state *state, > unsigned tabs, FILE *fp) > nir_block **preds = > malloc(block->predecessors->entries * sizeof(nir_block *)); > > + if (!preds) { > + _mesa_error_no_memory(__func__); > + return; > + } > + > struct set_entry *entry; > unsigned i = 0; > set_foreach(block->predecessors, entry) {
The NULL check is fine, but I don't see any reason for the shader printer to throw an OpenGL error. It's debugging code triggered by driver environment variables; it isn't related to any API call the application made. --Ken
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev