Mesa (master): glsl2: move constructor into . cpp file to work around compiler bug

Brian Paul brianp at kemper.freedesktop.org
Tue Aug 24 16:04:53 UTC 2010


Module: Mesa
Branch: master
Commit: 2eb8b2d3bb68cef1d3fc431debe1b18f6c017aeb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2eb8b2d3bb68cef1d3fc431debe1b18f6c017aeb

Author: Brian Paul <brianp at vmware.com>
Date:   Tue Aug 24 10:01:40 2010 -0600

glsl2: move constructor into .cpp file to work around compiler bug

Fixes fd.o bug 29770

The refcount==0 assertion only failed on some systems.  One example
being 32-bit Linux with gcc 4.4.4.

---

 src/glsl/ir_variable_refcount.cpp |   12 ++++++++++++
 src/glsl/ir_variable_refcount.h   |    9 +--------
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/glsl/ir_variable_refcount.cpp b/src/glsl/ir_variable_refcount.cpp
index 6614727..7d39abb 100644
--- a/src/glsl/ir_variable_refcount.cpp
+++ b/src/glsl/ir_variable_refcount.cpp
@@ -34,6 +34,18 @@
 #include "ir_variable_refcount.h"
 #include "glsl_types.h"
 
+
+// constructor
+variable_entry::variable_entry(ir_variable *var)
+{
+   this->var = var;
+   assign = NULL;
+   assigned_count = 0;
+   declaration = false;
+   referenced_count = 0;
+}
+
+
 variable_entry *
 ir_variable_refcount_visitor::get_variable_entry(ir_variable *var)
 {
diff --git a/src/glsl/ir_variable_refcount.h b/src/glsl/ir_variable_refcount.h
index 059ea09..8b43bad 100644
--- a/src/glsl/ir_variable_refcount.h
+++ b/src/glsl/ir_variable_refcount.h
@@ -36,14 +36,7 @@
 class variable_entry : public exec_node
 {
 public:
-   variable_entry(ir_variable *var)
-   {
-      this->var = var;
-      assign = NULL;
-      referenced_count = 0;
-      assigned_count = 0;
-      declaration = false;
-   }
+   variable_entry(ir_variable *var);
 
    ir_variable *var; /* The key: the variable's pointer. */
    ir_assignment *assign; /* An assignment to the variable, if any */




More information about the mesa-commit mailing list