compiler/glsl: Initialize local variable to zero to fix MSVC RTC error
authorBillKristiansen <billkris@microsoft.com>
Thu, 11 Jun 2020 17:38:19 +0000 (10:38 -0700)
committerMarge Bot <eric+marge@anholt.net>
Mon, 17 Aug 2020 09:31:37 +0000 (09:31 +0000)
Without this, we get a run-time error about using an uninitialized
variable.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6221>

src/compiler/glsl/ast_to_hir.cpp

index c406ae28ec2e32b9fa906a90e13937f41b7c31ab..6c0c3b6f365829841888c3a4f3aa89d00d710d36 100644 (file)
@@ -8007,7 +8007,7 @@ ast_interface_block::hir(exec_list *instructions,
       return NULL;
    }
 
-   unsigned qual_xfb_offset;
+   unsigned qual_xfb_offset = 0;
    if (layout.flags.q.explicit_xfb_offset) {
       if (!process_qualifier_constant(state, &loc, "xfb_offset",
                                       layout.offset, &qual_xfb_offset)) {
@@ -8015,7 +8015,7 @@ ast_interface_block::hir(exec_list *instructions,
       }
    }
 
-   unsigned qual_xfb_stride;
+   unsigned qual_xfb_stride = 0;
    if (layout.flags.q.explicit_xfb_stride) {
       if (!process_qualifier_constant(state, &loc, "xfb_stride",
                                       layout.xfb_stride, &qual_xfb_stride)) {