зеркало из 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_;
|
js::gc::StoreBuffer *gcStoreBufferPtr_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Runtime(js::gc::StoreBuffer *storeBuffer)
|
Runtime()
|
||||||
: needsIncrementalBarrier_(false)
|
: needsIncrementalBarrier_(false)
|
||||||
, gcStoreBufferPtr_(storeBuffer)
|
, gcStoreBufferPtr_(nullptr)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
bool needsIncrementalBarrier() const {
|
bool needsIncrementalBarrier() const {
|
||||||
|
@ -161,6 +161,11 @@ struct Runtime
|
||||||
return reinterpret_cast<JS::shadow::Runtime*>(rt);
|
return reinterpret_cast<JS::shadow::Runtime*>(rt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void setGCStoreBufferPtr(js::gc::StoreBuffer *storeBuffer) {
|
||||||
|
gcStoreBufferPtr_ = storeBuffer;
|
||||||
|
}
|
||||||
|
|
||||||
/* Allow inlining of PersistentRooted constructors and destructors. */
|
/* Allow inlining of PersistentRooted constructors and destructors. */
|
||||||
private:
|
private:
|
||||||
template <typename Referent> friend class JS::PersistentRooted;
|
template <typename Referent> friend class JS::PersistentRooted;
|
||||||
|
|
|
@ -130,8 +130,7 @@ ReturnZeroSize(const void *p)
|
||||||
}
|
}
|
||||||
|
|
||||||
JSRuntime::JSRuntime(JSRuntime *parentRuntime)
|
JSRuntime::JSRuntime(JSRuntime *parentRuntime)
|
||||||
: JS::shadow::Runtime(&gc.storeBuffer),
|
: mainThread(this),
|
||||||
mainThread(this),
|
|
||||||
parentRuntime(parentRuntime),
|
parentRuntime(parentRuntime),
|
||||||
interrupt_(false),
|
interrupt_(false),
|
||||||
interruptPar_(false),
|
interruptPar_(false),
|
||||||
|
@ -230,6 +229,8 @@ JSRuntime::JSRuntime(JSRuntime *parentRuntime)
|
||||||
oomCallback(nullptr),
|
oomCallback(nullptr),
|
||||||
debuggerMallocSizeOf(ReturnZeroSize)
|
debuggerMallocSizeOf(ReturnZeroSize)
|
||||||
{
|
{
|
||||||
|
setGCStoreBufferPtr(&gc.storeBuffer);
|
||||||
|
|
||||||
liveRuntimesCount++;
|
liveRuntimesCount++;
|
||||||
|
|
||||||
/* Initialize infallibly first, so we can goto bad and JS_DestroyRuntime. */
|
/* Initialize infallibly first, so we can goto bad and JS_DestroyRuntime. */
|
||||||
|
|
Загрузка…
Ссылка в новой задаче