From 4f2063cce10295e8b982e98d466c9130d754a540 Mon Sep 17 00:00:00 2001 From: "avi@chromium.org" Date: Wed, 19 Jan 2011 22:34:40 +0000 Subject: Initialized pair_id variable to 0. This variable was uninitialized and the compiler gave a warning (which got converted into an error because we compile using -Werror) when GetIDAndCountOfFormElement() and its children are inlined. This is because there is a path in that function that returns true but leaves the pair_id variable uninitialized (if s.Step() is 0). Note that I am not a Chromium committer so you will have to commit this. Patch by asharif; http://codereview.chromium.org/6293011/ BUG=70144 TEST=no visible change git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71860 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/webdata/web_database.cc | 3 ++- chrome/browser/webdata/web_database.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/chrome/browser/webdata/web_database.cc b/chrome/browser/webdata/web_database.cc index 6e4a3fb..eea663c 100644 --- a/chrome/browser/webdata/web_database.cc +++ b/chrome/browser/webdata/web_database.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -1202,6 +1202,7 @@ bool WebDatabase::GetIDAndCountOfFormElement( s.BindString16(0, element.name()); s.BindString16(1, element.value()); + *pair_id = 0; *count = 0; if (s.Step()) { diff --git a/chrome/browser/webdata/web_database.h b/chrome/browser/webdata/web_database.h index 17bc19c..0356381 100644 --- a/chrome/browser/webdata/web_database.h +++ b/chrome/browser/webdata/web_database.h @@ -183,7 +183,8 @@ class WebDatabase { bool AddToCountOfFormElement(int64 pair_id, int delta, bool* was_removed); // Gets the pair_id and count entries from name and value specified in - // |element|. Sets *count to 0 if there is no such row in the table. + // |element|. Sets *pair_id and *count to 0 if there is no such row in + // the table. bool GetIDAndCountOfFormElement(const webkit_glue::FormField& element, int64* pair_id, int* count); -- cgit v1.1