From: Eric Anholt Date: Wed, 12 Jun 2013 20:46:57 +0000 (-0700) Subject: glsl: Make sure that we don't put too many bitfields in ast_type_qualifier. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f2e14238a79100f22ccdcdda2a2267ff9fc85655;p=mesa.git glsl: Make sure that we don't put too many bitfields in ast_type_qualifier. We do some tests of qualifiers using a union containing an int and the struct full of bitfields, so make sure the bitfields don't spill outside the int. Reviewed-by: Ian Romanick Reviewed-by: Kenneth Graunke --- diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 10c5425e8ee..f3c49d2271d 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -1936,6 +1936,8 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, bool ubo_qualifiers_valid, bool is_parameter) { + STATIC_ASSERT(sizeof(qual->flags.q) <= sizeof(qual->flags.i)); + if (qual->flags.q.invariant) { if (var->used) { _mesa_glsl_error(loc, state,