mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Follow-up to bug 990787 - Fix GC hazards introduced by part 1 and part 4, caught by static analysis. Pushing to a CLOSED TREE. r=sfink.
This commit is contained in:
parent
06912887b1
commit
fa1d1db711
@ -1083,12 +1083,7 @@ ThreadSafeContext::recoverFromOutOfMemory()
|
|||||||
// If this is not a JSContext, there's nothing to do.
|
// If this is not a JSContext, there's nothing to do.
|
||||||
if (JSContext *maybecx = maybeJSContext()) {
|
if (JSContext *maybecx = maybeJSContext()) {
|
||||||
if (maybecx->isExceptionPending()) {
|
if (maybecx->isExceptionPending()) {
|
||||||
#ifdef DEBUG
|
MOZ_ASSERT(maybecx->isThrowingOutOfMemory());
|
||||||
RootedValue v(maybecx);
|
|
||||||
bool ok = maybecx->getPendingException(&v);
|
|
||||||
MOZ_ASSERT(ok);
|
|
||||||
MOZ_ASSERT(v == StringValue(maybecx->names().outOfMemory));
|
|
||||||
#endif
|
|
||||||
maybecx->clearPendingException();
|
maybecx->clearPendingException();
|
||||||
} else {
|
} else {
|
||||||
MOZ_ASSERT(maybecx->runtime()->hadOutOfMemory);
|
MOZ_ASSERT(maybecx->runtime()->hadOutOfMemory);
|
||||||
@ -1150,6 +1145,12 @@ JSContext::getPendingException(MutableHandleValue rval)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
JSContext::isThrowingOutOfMemory()
|
||||||
|
{
|
||||||
|
return throwing && unwrappedException_ == StringValue(names().outOfMemory);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
JSContext::enterGenerator(JSGenerator *gen)
|
JSContext::enterGenerator(JSGenerator *gen)
|
||||||
{
|
{
|
||||||
|
@ -560,6 +560,8 @@ struct JSContext : public js::ExclusiveContext,
|
|||||||
MOZ_WARN_UNUSED_RESULT
|
MOZ_WARN_UNUSED_RESULT
|
||||||
bool getPendingException(JS::MutableHandleValue rval);
|
bool getPendingException(JS::MutableHandleValue rval);
|
||||||
|
|
||||||
|
bool isThrowingOutOfMemory();
|
||||||
|
|
||||||
void setPendingException(js::Value v);
|
void setPendingException(js::Value v);
|
||||||
|
|
||||||
void clearPendingException() {
|
void clearPendingException() {
|
||||||
|
Loading…
Reference in New Issue
Block a user