Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3423)

Issue 6294043: Fixes a bug caused by a reallocation on vector. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 10 months ago by hsumita1
Modified:
11 years, 10 months ago
Reviewers:
shawn.p.huang, Peng Huang, penghuang, Peng
Base URL:
git://github.com/ibus/ibus-pinyin.git@master
Visibility:
Public.

Description

Fixes a bug caused by a reallocation on vector. BUG=Database::query crashes on some situation TEST=Manual

Patch Set 1 #

Patch Set 2 : Add comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -1 line) Patch
M src/PYDatabase.cc View 1 2 chunks +7 lines, -1 line 0 comments Download

Messages

Total messages: 5
hsumita1
11 years, 10 months ago (2012-06-05 07:14:00 UTC) #1
Peng
lgtm. But don't understand why origin code has problem. Please explain it. Thanks.
11 years, 10 months ago (2012-06-05 14:09:32 UTC) #2
Peng
On 2012/06/05 14:09:32, Peng wrote: > lgtm. But don't understand why origin code has problem. ...
11 years, 10 months ago (2012-06-05 14:15:15 UTC) #3
hsumita1
Please see also http://cplusplus.com/reference/stl/vector/push_back/ > This effectively increases the vector size by one, which causes ...
11 years, 10 months ago (2012-06-06 05:04:04 UTC) #4
Peng
11 years, 10 months ago (2012-06-06 14:18:58 UTC) #5
On 2012/06/06 05:04:04, hsumita1 wrote:
> Please see also
> 
> http://cplusplus.com/reference/stl/vector/push_back/
> > This effectively increases the vector size by one, which causes a
reallocation
> of the internal allocated
> > storage if the vector size was equal to the vector capacity before the call.
> Reallocations invalidate all
> > previously obtained iterators, references and pointers.
> 
> By this error, Database::query returns NULL pointer, and ibus-pinyin crashes
on
> g_assert on Query::fill.

I see. Thank you.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b