From 206ca337182eaec4287042654d8d1253484ae15c Mon Sep 17 00:00:00 2001 From: "rnk@chromium.org" Date: Mon, 26 Mar 2012 23:37:15 +0000 Subject: [PATCH] Avoid coercing integers to doubles when swapping for bubble sort. score_ is partially initialized, and while ultimately the uninit elements are not used, coercing them to floating point generates uninit reports when run under drmemory. It's also unecessary, so I'm removing it. BUG=115326 R=jshin@chromium.org,timurrrr@chromium.org TEST=comact_lang_det_unittest_small.cc under drmemory Review URL: http://codereview.chromium.org/9465026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129050 0039d316-1c4b-4281-b951-d872f2087c98 --- third_party/cld/encodings/compact_lang_det/tote.cc | 4 ++-- tools/valgrind/drmemory/suppressions_full.txt | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/third_party/cld/encodings/compact_lang_det/tote.cc b/third_party/cld/encodings/compact_lang_det/tote.cc index 21087a83af8cd5..75e5051964b747 100644 --- a/third_party/cld/encodings/compact_lang_det/tote.cc +++ b/third_party/cld/encodings/compact_lang_det/tote.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -275,7 +275,7 @@ void ToteWithReliability::Sort(int n) { value_[sub] = value_[sub2]; value_[sub2] = tmpv; - double tmps = score_[sub]; + int tmps = score_[sub]; score_[sub] = score_[sub2]; score_[sub2] = tmps; diff --git a/tools/valgrind/drmemory/suppressions_full.txt b/tools/valgrind/drmemory/suppressions_full.txt index e684301c0060dd..ff448dc86d7f18 100644 --- a/tools/valgrind/drmemory/suppressions_full.txt +++ b/tools/valgrind/drmemory/suppressions_full.txt @@ -1163,10 +1163,6 @@ name=http://crbug.com/113847 (2) *!openDatabase *!sqlite3_open -UNINITIALIZED READ -name=http://crbug.com/115326 -*!ToteWithReliability::Sort - # Some unit tests must not be waiting for the file thread after deleting the # AppNotificationManager. LEAK