resize in combination with std::copy does
it as well.
Michael
Dipl.-Inf. Michael Raab
Fraunhofer-Institut für Fabrikbetrieb und -automatisierung IFF
Virtuell Interaktives Training
Sandtorstr. 22, 39106 Magdeburg, Germany
Telefon +49 (0) 391/ 40 90 122
Telefax +49 (0) 391/ 40 90 115
address@hidden http://www.iff.fraunhofer.de
oder http://www.vdtc.de
Von:
Eric Noulard <address@hidden>
An:
CERTI development discussions
<address@hidden>
Datum:
11/10/2010 09:20 AM
Betreff:
Re: [certi-dev]
Crash with some STL vector
Gesendet von:
address@hidden
2010/11/10 Michael Raab <address@hidden>:
> Hi Eric,
>
> your blind fix did not change anything. :-(
This is the main inconvient with blindness it's hard to see.
> The good news is, I think I found the error,
> I changed the following in RTItypesImp.cc, line 187 ff
[...]
> I would guess that std::copy operates not well with std::vector::reserve
as
> afaik rerserve doesn't resize the vector.
That's the reason and you are perfecttly right "reserve" does
not do
any allocation.
"reserve" has to be replaced by "resize" in this case.
We'll have to check whether if other "reserve" call does not
in fact
means resize.
> The I think you were writing over some border.
> Would you check this into the repository?
I did check-in a similar fix but I think we can keep
std::copy if reserve is called.
Would you try this?
> Thanks,
Thank you for tracking this down.
--
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org