зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1119232 - Fix a warning for the usage of the uninitialized gc member in JSRuntime's constructor; r=jandem
clang emits the following warning on this code: warning: field 'gc' is uninitialized when used here [-Wuninitialized] The warning is not an indication of a real bug since we're just taking the store buffer's address, but we may as well silence it.
This commit is contained in:
Родитель
895b53981b
Коммит
6c043d2ab7
|
@ -146,9 +146,9 @@ struct Runtime
|
|||
js::gc::StoreBuffer *gcStoreBufferPtr_;
|
||||
|
||||
public:
|
||||
explicit Runtime(js::gc::StoreBuffer *storeBuffer)
|
||||
Runtime()
|
||||
: needsIncrementalBarrier_(false)
|
||||
, gcStoreBufferPtr_(storeBuffer)
|
||||
, gcStoreBufferPtr_(nullptr)
|
||||
{}
|
||||
|
||||
bool needsIncrementalBarrier() const {
|
||||
|
@ -161,6 +161,11 @@ struct Runtime
|
|||
return reinterpret_cast<JS::shadow::Runtime*>(rt);
|
||||
}
|
||||
|
||||
protected:
|
||||
void setGCStoreBufferPtr(js::gc::StoreBuffer *storeBuffer) {
|
||||
gcStoreBufferPtr_ = storeBuffer;
|
||||
}
|
||||
|
||||
/* Allow inlining of PersistentRooted constructors and destructors. */
|
||||
private:
|
||||
template <typename Referent> friend class JS::PersistentRooted;
|
||||
|
|
|
@ -130,8 +130,7 @@ ReturnZeroSize(const void *p)
|
|||
}
|
||||
|
||||
JSRuntime::JSRuntime(JSRuntime *parentRuntime)
|
||||
: JS::shadow::Runtime(&gc.storeBuffer),
|
||||
mainThread(this),
|
||||
: mainThread(this),
|
||||
parentRuntime(parentRuntime),
|
||||
interrupt_(false),
|
||||
interruptPar_(false),
|
||||
|
@ -230,6 +229,8 @@ JSRuntime::JSRuntime(JSRuntime *parentRuntime)
|
|||
oomCallback(nullptr),
|
||||
debuggerMallocSizeOf(ReturnZeroSize)
|
||||
{
|
||||
setGCStoreBufferPtr(&gc.storeBuffer);
|
||||
|
||||
liveRuntimesCount++;
|
||||
|
||||
/* Initialize infallibly first, so we can goto bad and JS_DestroyRuntime. */
|
||||
|
|
Загрузка…
Ссылка в новой задаче