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 (JSContext *maybecx = maybeJSContext()) {
|
||||
if (maybecx->isExceptionPending()) {
|
||||
#ifdef DEBUG
|
||||
RootedValue v(maybecx);
|
||||
bool ok = maybecx->getPendingException(&v);
|
||||
MOZ_ASSERT(ok);
|
||||
MOZ_ASSERT(v == StringValue(maybecx->names().outOfMemory));
|
||||
#endif
|
||||
MOZ_ASSERT(maybecx->isThrowingOutOfMemory());
|
||||
maybecx->clearPendingException();
|
||||
} else {
|
||||
MOZ_ASSERT(maybecx->runtime()->hadOutOfMemory);
|
||||
@ -1150,6 +1145,12 @@ JSContext::getPendingException(MutableHandleValue rval)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
JSContext::isThrowingOutOfMemory()
|
||||
{
|
||||
return throwing && unwrappedException_ == StringValue(names().outOfMemory);
|
||||
}
|
||||
|
||||
void
|
||||
JSContext::enterGenerator(JSGenerator *gen)
|
||||
{
|
||||
|
@ -560,6 +560,8 @@ struct JSContext : public js::ExclusiveContext,
|
||||
MOZ_WARN_UNUSED_RESULT
|
||||
bool getPendingException(JS::MutableHandleValue rval);
|
||||
|
||||
bool isThrowingOutOfMemory();
|
||||
|
||||
void setPendingException(js::Value v);
|
||||
|
||||
void clearPendingException() {
|
||||
|
Loading…
Reference in New Issue
Block a user