Skip to content

Commit

Permalink
Fixes a bug caused by a reallocation on vector.
Browse files Browse the repository at this point in the history
BUG=Database::query crashes on some situation
TEST=Manual

Review URL: https://codereview.appspot.com/6294043
Patch from Hiroshi Sumita <hsumita@chromium.org>.
  • Loading branch information
hsumita authored and phuang committed Jun 5, 2012
1 parent 8383301 commit df6277e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/PYDatabase.cc
Expand Up @@ -46,15 +46,17 @@ class Conditions : public std::vector<std::string> {

void double_ (void) {
gint i = size ();
reserve (i * 2);
do {
push_back (at (--i));
} while (i > 0);
}

void triple (void) {
gint i = size ();
reserve (i * 3);
do {
const std::string & value = std::vector<std::string>::at (--i);
const std::string & value = at (--i);
push_back (value);
push_back (value);
} while (i > 0);
Expand Down

0 comments on commit df6277e

Please sign in to comment.