glsl: fix variable scope for do-while loops
authorTimothy Arceri <tarceri@itsqueeze.com>
Mon, 23 Aug 2021 08:54:16 +0000 (18:54 +1000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 8 Sep 2021 03:56:59 +0000 (03:56 +0000)
commit52893327fb0cc085df6b7b38de0cf240d5f9ae5e
treeb92900306c8ad86b49a7829c9815f45f8079e1ac
parent174c057926fddd637d3c038c3162559a38bebe88
glsl: fix variable scope for do-while loops

Without this the following code was successfully compiling.

   void main()
   {
      do
         int var_1 = 0;
      while (false);

      var_1++;
   }

Fixes: a87ac255cf7e ("Initial commit.  lol")

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12465>
src/compiler/glsl/ast_to_hir.cpp
src/compiler/glsl/glsl_parser.yy