On 12/23/2011 05:31 PM, Ian Romanick wrote: > From: Ian Romanick <[email protected]> > > Other parts of the compiler assume that expressions will have > well-formed types or the error type. Just using the type of the thing > being operated on can cause expressions like ~3.14 or ~false to not > have a well-formed type. This could then result in an assertion > failure in the context epxression handler. > > If there is an error processing the expression, set the type of the IR > expression to error. > > Fixes piglit's bit-not-0[789].frag tests. > > NOTE: This is a candidate for the 7.11 branch. > > Signed-off-by: Ian Romanick <[email protected]> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42755 > Cc: Vinson Lee <[email protected]> > --- > src/glsl/ast_to_hir.cpp | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp > index 6aedbee..30efe37 100644 > --- a/src/glsl/ast_to_hir.cpp > +++ b/src/glsl/ast_to_hir.cpp > @@ -1186,7 +1186,7 @@ ast_expression::hir(exec_list *instructions, > error_emitted = true; > } > > - type = op[0]->type; > + type = error_emitted ? glsl_type::error_type : op[0]->type; > result = new(ctx) ir_expression(ir_unop_bit_not, type, op[0], NULL); > break; >
Reviewed-by: Kenneth Graunke <[email protected]> _______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
