Commit 4f2063cc authored by avi@chromium.org's avatar avi@chromium.org

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
parent 93270d00
// 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()) {
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment