From: David Reiss Date: Wed, 2 Apr 2008 00:23:31 +0000 (+0000) Subject: Fix a segfault in the compiler. X-Git-Tag: 0.2.0~845 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=f5ece05649298ee312841e8e16c6d7467316325c;p=common%2Fthrift.git Fix a segfault in the compiler. 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 --- diff --git a/compiler/cpp/src/parse/t_type.h b/compiler/cpp/src/parse/t_type.h index bf8d7fa7..a10e31f9 100644 --- a/compiler/cpp/src/parse/t_type.h +++ b/compiler/cpp/src/parse/t_type.h @@ -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_));