зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1271507 - Ensure the SourceCompressionTask becomes inactive on OOM; r=jimb
This commit is contained in:
Родитель
316a0874c5
Коммит
1fffb8d53b
|
@ -0,0 +1,4 @@
|
|||
// |jit-test| allow-oom
|
||||
|
||||
// Adapted from randomly chosen testcase: js/src/jit-test/tests/debug/bug-1238610.js
|
||||
load(libdir + "../tests/basic/bug-1271507.js");
|
|
@ -1629,6 +1629,8 @@ SourceCompressionTask::complete()
|
|||
if (!ss->setCompressedSource(cx, mozilla::Move(compressedSource), compressedBytes,
|
||||
ss->length()))
|
||||
{
|
||||
ss = nullptr;
|
||||
MOZ_ASSERT(!active());
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -111,6 +111,7 @@ MOZ_MUST_USE mozilla::Maybe<SharedImmutableString>
|
|||
SharedImmutableStringsCache::getOrCreate(OwnedChars&& chars, size_t length)
|
||||
{
|
||||
OwnedChars owned(mozilla::Move(chars));
|
||||
MOZ_ASSERT(owned);
|
||||
return getOrCreate(owned.get(), length, [&]() { return mozilla::Move(owned); });
|
||||
}
|
||||
|
||||
|
@ -124,6 +125,7 @@ MOZ_MUST_USE mozilla::Maybe<SharedImmutableTwoByteString>
|
|||
SharedImmutableStringsCache::getOrCreate(OwnedTwoByteChars&& chars, size_t length)
|
||||
{
|
||||
OwnedTwoByteChars owned(mozilla::Move(chars));
|
||||
MOZ_ASSERT(owned);
|
||||
return getOrCreate(owned.get(), length, [&]() { return mozilla::Move(owned); });
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче