[REVIEW-3-5] Re: [PUSHED][3-5] Re: [REVIEW-3-5] MSVC stl usage.

Michael Stahl mstahl at redhat.com
Tue Jun 12 05:19:04 PDT 2012


On 12.06.2012 13:54, Stephan Bergmann wrote:
> On 06/12/2012 01:32 PM, Michael Stahl wrote:
>> On 12.06.2012 13:14, Muthu Subramanian K wrote:
>>> Can somebody review and cherry-pick this one please?
>>> http://cgit.freedesktop.org/libreoffice/core/commit/?id=25dd603fe2044f35341fe0c6d0b632c9295a824e
>>
>> hmm... that old code looks legit to me?
> 
> No, growing a vector (which push_back can do) invalidates all references 
> into the vector.

ah, back() returns a reference, not a value?
then of course it was wrong.

hmm... grep finds some more occurrences of this...

> sc/source/filter/html/htmlpars.cxx:        rSizes.push_back( rSizes.empty() ? 1 : (rSizes.back() + 1) );

this one can't go wrong because has to dereferences before calling
push_back.

i've fixed the other ones, please review and push to libreoffice-3-5:

http://cgit.freedesktop.org/libreoffice/core/commit/?id=cd18b8e313b792f5fc42edb3314a95d202406899



More information about the LibreOffice mailing list