Fix a segfault in the compiler.
authorDavid Reiss <dreiss@apache.org>
Wed, 2 Apr 2008 00:23:31 +0000 (00:23 +0000)
committerDavid Reiss <dreiss@apache.org>
Wed, 2 Apr 2008 00:23:31 +0000 (00:23 +0000)
We weren't initializing our pointers properly, resulting in
a difficult-to-trigger segfault.

Reviewed By: mcslee, bhamadani

Test Plan: Built the modified search IDL.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665627 13f79535-47bb-0310-9956-ffa450edef68

compiler/cpp/src/parse/t_type.h

index bf8d7fa..a10e31f 100644 (file)
@@ -116,7 +116,9 @@ class t_type : public t_doc {
 
 
  protected:
-  t_type() {
+  t_type() :
+    program_(NULL)
+  {
     memset(fingerprint_, 0, sizeof(fingerprint_));
   }
 
@@ -134,6 +136,7 @@ class t_type : public t_doc {
   }
 
   t_type(std::string name) :
+    program_(NULL),
     name_(name)
   {
     memset(fingerprint_, 0, sizeof(fingerprint_));