Mesa (master): compiler/glsl: Initialize local variable to zero to fix MSVC RTC error
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Aug 17 09:53:21 UTC 2020
Module: Mesa
Branch: master
Commit: ff4c991fd1c1f5f211ba9251f9c4701a1e013bf2
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ff4c991fd1c1f5f211ba9251f9c4701a1e013bf2
Author: BillKristiansen <billkris at microsoft.com>
Date: Thu Jun 11 10:38:19 2020 -0700
compiler/glsl: Initialize local variable to zero to fix MSVC RTC error
Without this, we get a run-time error about using an uninitialized
variable.
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6221>
---
src/compiler/glsl/ast_to_hir.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index c406ae28ec2..6c0c3b6f365 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -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)) {
More information about the mesa-commit
mailing list