[LyX/master] Add move constructor and move assignment operator for FileName class

Yuriy Skalko yuriy.skalko at gmail.com
Sun Jan 17 13:35:48 UTC 2021

>> Thanks Stephan. It crashes on the call to move(?) assignment operator, but it 
>> is still not clear looking on these sources. I haven't tried Valgrind yet.
> To trigger the crash I picked the second file out of the five files in the 
> lastfiles vector. (But this happens with the first and with the last entry the 
> same way.)
> This operation effectively should move the 2nd entry to the 1st position.
> The implemented logic in LastFilesSection::add removes the 2nd entry because of 
> the match and inserts this FileName instance at position 1.
> IMO the assignee (the new 1st slot of the lastfiles vector) hasn’t allocated 
> the memory for private member d when the assignment operator is called - 
> instead it is zero filled at that point.
> I’m not so familiar with C++ internals. Perhaps the constructor wasn’t called 
> or a wrong one or the move assignment constructor should care for it. Perhaps 
> it is the implementation of the vector?
> Stephan

I've had a chance to use Valgrind. It runs without any issues there.
The next step from my side should be clang installation and debugging 
this patch there. But it can happen not very soon.


More information about the lyx-devel mailing list