From f2e14238a79100f22ccdcdda2a2267ff9fc85655 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 12 Jun 2013 13:46:57 -0700 Subject: [PATCH] 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 --- src/glsl/ast_to_hir.cpp | 2 ++ 1 file changed, 2 insertions(+) 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, -- 2.30.2