Bug 1531027 - Add an explicit copy constructor to StackTrace. r=ehsan

This only copies the first `mLength` elements in `mPcs`.

Differential Revision: https://phabricator.services.mozilla.com/D21488

--HG--
extra : rebase_source : 91601501056fe7ea5b011adeca59033568fbde4a
This commit is contained in:
Nicholas Nethercote 2019-02-28 11:00:14 +11:00
Родитель 3494926e55
Коммит e01d4bc8cc
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -39,8 +39,8 @@
#include "mozilla/JSONWriter.h"
#include "mozilla/Likely.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/PodOperations.h"
#include "mozilla/StackWalk.h"
#include "mozilla/Vector.h"
// CodeAddressService is defined entirely in the header, so this does not make
// DMD depend on XPCOM's object file.
@ -596,6 +596,9 @@ class StackTrace {
public:
StackTrace() : mLength(0) {}
StackTrace(const StackTrace& aOther) : mLength(aOther.mLength) {
PodCopy(mPcs, aOther.mPcs, mLength);
}
uint32_t Length() const { return mLength; }
const void* Pc(uint32_t i) const {