From patchwork Sat Apr 16 20:30:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Novillo X-Patchwork-Id: 91500 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 2C103B6F68 for ; Sun, 17 Apr 2011 06:30:43 +1000 (EST) Received: (qmail 9568 invoked by alias); 16 Apr 2011 20:30:42 -0000 Received: (qmail 9555 invoked by uid 22791); 16 Apr 2011 20:30:41 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 16 Apr 2011 20:30:28 +0000 Received: from hpaq12.eem.corp.google.com (hpaq12.eem.corp.google.com [172.25.149.12]) by smtp-out.google.com with ESMTP id p3GKUPhB027075; Sat, 16 Apr 2011 13:30:26 -0700 Received: from tobiano.tor.corp.google.com (tobiano.tor.corp.google.com [172.29.41.6]) by hpaq12.eem.corp.google.com with ESMTP id p3GKUNq4003821; Sat, 16 Apr 2011 13:30:24 -0700 Received: by tobiano.tor.corp.google.com (Postfix, from userid 54752) id 575C1AE18B; Sat, 16 Apr 2011 16:30:23 -0400 (EDT) To: reply@codereview.appspotmail.com, davidxl@google.com, libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [pph] Initialize fields in default ctor for _Hashtable_iterator (issue4430051) Message-Id: <20110416203023.575C1AE18B@tobiano.tor.corp.google.com> Date: Sat, 16 Apr 2011 16:30:23 -0400 (EDT) From: dnovillo@google.com (Diego Novillo) X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org I am committing this patch for David Li on google/main. The patch adds explicit initialization to the fields of _Hashtable_iterator in its default constructor. David, could you describe why this change was needed? Will you be submitting for trunk? Tested on x86_64. Committed to google/main. Diego. 2011-04-15 Xinliang David Li Google ref 43787. * include/backward/hashtable.h (_Hashtable_iterator::_Hashtable_iterator): Initialize _M_cur and _M_ht in default constructor. --- This patch is available for review at http://codereview.appspot.com/4430051 diff --git a/libstdc++-v3/include/backward/hashtable.h b/libstdc++-v3/include/backward/hashtable.h index 0bcaec4..c3eefcc 100644 --- a/libstdc++-v3/include/backward/hashtable.h +++ b/libstdc++-v3/include/backward/hashtable.h @@ -126,7 +126,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _Hashtable_iterator(_Node* __n, _Hashtable* __tab) : _M_cur(__n), _M_ht(__tab) { } - _Hashtable_iterator() { } + _Hashtable_iterator() + : _M_cur(0), _M_ht(0) { } reference operator*() const