Fix for potentially uninitialized variables
authorJari Komppa <jari.komppa@siru.fi>
Tue, 11 Jan 2022 14:58:31 +0000 (16:58 +0200)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Thu, 20 Jan 2022 20:17:17 +0000 (20:17 +0000)
This change adds a constructor for a struct which sets the members that
do not have a constructor of their own to known values.

This potentially affects anything that uses the reference rasterizer,
but should not change any test results.

Affects:
*

Components: Framework
VK-GL-CTS issue: 3434

Change-Id: Ie874b4baa4d2ff5a8aa66f9ea2c3cd11b37edb64

framework/common/tcuRasterizationVerifier.hpp

index 9f7ab1f..b0663a2 100644 (file)
@@ -66,6 +66,12 @@ struct TriangleSceneSpec
                tcu::Vec4       positions[3];
                tcu::Vec4       colors[3];
                bool            sharedEdge[3]; // !< is the edge i -> i+1 shared with another scene triangle
+               SceneTriangle()
+               {
+                       // Other members are initialized in Vector constructor
+                       for (int i = 0; i < 3; i++)
+                               sharedEdge[i] = false;
+               }
        };
 
        std::vector<SceneTriangle> triangles;