ast: Initialize location data in constructor of all ast_node objects.
authorCarl Worth <cworth@cworth.org>
Thu, 29 Jul 2010 23:39:36 +0000 (16:39 -0700)
committerCarl Worth <cworth@cworth.org>
Fri, 30 Jul 2010 22:03:37 +0000 (15:03 -0700)
This prevents using uninitialized data in _msea_glsl_error in some
cases, (including at least 6 piglit tests). Thanks to valgrind for
pointing out the problem!

src/glsl/glsl_parser_extras.cpp

index 20a5021..15fa61d 100644 (file)
@@ -280,7 +280,9 @@ ast_node::print(void) const
 
 ast_node::ast_node(void)
 {
-   /* empty */
+   this->location.source = 0;
+   this->location.line = 0;
+   this->location.column = 0;
 }