summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2012-11-09 09:17:22 -0800
committerEric Anholt <[email protected]>2013-04-19 10:12:27 -0700
commitfe955dc6b626a43036ff2a4cfe44511e10a09332 (patch)
tree19039b7025a22550fae0c43ddfe075475f2d12c2 /src/mesa
parentea6cf2b68614e9f8d0db44ee917ce93f9ad1ac2f (diff)
mesa: Fix up program_parse.y to avoid uninitialized $$
Without this patch, $$.negate, $$.rgba_valid, and $$.xyzw_valid take on garbage values. At the moment this problem is benign (the garbage values happen to be zero), but in my experiments executing GL operations on a background thread, the garbage values change, leading to piglit failures. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/program/program_parse.y5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/program/program_parse.y b/src/mesa/program/program_parse.y
index 81d85f9fb1b..8e4fdb61a75 100644
--- a/src/mesa/program/program_parse.y
+++ b/src/mesa/program/program_parse.y
@@ -709,6 +709,7 @@ extSwizSel: INTEGER
}
$$.swz = ($1 == 0) ? SWIZZLE_ZERO : SWIZZLE_ONE;
+ $$.negate = 0;
/* 0 and 1 are valid for both RGBA swizzle names and XYZW
* swizzle names.
@@ -728,6 +729,10 @@ extSwizSel: INTEGER
s = $1[0];
free($1);
+ $$.rgba_valid = 0;
+ $$.xyzw_valid = 0;
+ $$.negate = 0;
+
switch (s) {
case 'x':
$$.swz = SWIZZLE_X;