Bug 1389851 - js: Fix -Wunreachable-code-return warning in StoreBuffer.cpp. r?jonco
js/src/gc/StoreBuffer.cpp:138:8: warning: 'return' will never be executed [-Wunreachable-code-return]
This `return nullptr` statement is unreachable because oomUnsafe.crash() is a noreturn function.
MozReview-Commit-ID: KOkZMf2kQL5
--- a/js/src/gc/StoreBuffer.cpp
+++ b/js/src/gc/StoreBuffer.cpp
@@ -127,20 +127,18 @@ js::gc::AllocateWholeCellSet(Arena* aren
{
Zone* zone = arena->zone;
if (!zone->group()->nursery().isEnabled())
return nullptr;
AutoEnterOOMUnsafeRegion oomUnsafe;
Nursery& nursery = zone->group()->nursery();
void* data = nursery.allocateBuffer(zone, sizeof(ArenaCellSet));
- if (!data) {
+ if (!data)
oomUnsafe.crash("Failed to allocate WholeCellSet");
- return nullptr;
- }
if (nursery.freeSpace() < ArenaCellSet::NurseryFreeThresholdBytes)
zone->group()->storeBuffer().setAboutToOverflow(JS::gcreason::FULL_WHOLE_CELL_BUFFER);
auto cells = static_cast<ArenaCellSet*>(data);
new (cells) ArenaCellSet(arena);
arena->bufferedCells() = cells;
zone->group()->storeBuffer().addToWholeCellBuffer(cells);