Bug 1237201 part 9 - Fix remaining issues. r=nfroyd

This commit is contained in:
Jan de Mooij 2016-01-14 22:12:13 +01:00
parent 1ad69c0f15
commit a33fee8b54
6 changed files with 20 additions and 9 deletions

View File

@ -252,7 +252,9 @@ ReserveFileDescriptors(FdArray& aReservedFds)
MOZ_CRASH("ProcLoader error: failed to reserve a magic file descriptor.");
}
aReservedFds.append(target);
if (!aReservedFds.append(target)) {
MOZ_CRASH("Failed to append to aReservedFds");
}
if (fd == target) {
// No need to call dup2(). We already occupy the desired file descriptor.

View File

@ -513,7 +513,8 @@ bool js_StartPerf()
"--pid", mainPidStr, "--output", outfile};
Vector<const char*, 0, SystemAllocPolicy> args;
args.append(defaultArgs, ArrayLength(defaultArgs));
if (!args.append(defaultArgs, ArrayLength(defaultArgs)))
return false;
const char* flags = getenv("MOZ_PROFILE_PERF_FLAGS");
if (!flags) {
@ -530,11 +531,13 @@ bool js_StartPerf()
char* toksave;
char* tok = strtok_r(flags2, " ", &toksave);
while (tok) {
args.append(tok);
if (!args.append(tok))
return false;
tok = strtok_r(nullptr, " ", &toksave);
}
args.append((char*) nullptr);
if (!args.append((char*) nullptr))
return false;
execvp("perf", const_cast<char**>(args.begin()));

View File

@ -10,6 +10,7 @@
#include "mozilla/DebugOnly.h"
#include "mozilla/IntegerPrintfMacros.h"
#include "mozilla/Move.h"
#include "mozilla/unused.h"
#include "jscompartment.h"
#include "jsfriendapi.h"
@ -539,7 +540,7 @@ js::Nursery::collect(JSRuntime* rt, JS::gcreason::Reason reason, ObjectGroupList
for (size_t i = 0; i < ArrayLength(tenureCounts.entries); i++) {
const TenureCount& entry = tenureCounts.entries[i];
if (entry.count >= 3000)
(void)pretenureGroups->append(entry.group); // ignore alloc failure
mozilla::Unused << pretenureGroups->append(entry.group); // ignore alloc failure
}
}
TIME_END(pretenure);

View File

@ -7,6 +7,8 @@
#ifndef jit_StackSlotAllocator_h
#define jit_StackSlotAllocator_h
#include "mozilla/unused.h"
#include "jit/Registers.h"
namespace js {
@ -21,10 +23,10 @@ class StackSlotAllocator
void addAvailableSlot(uint32_t index) {
// Ignoring OOM here (and below) is fine; it just means the stack slot
// will be unused.
(void)normalSlots.append(index);
mozilla::Unused << normalSlots.append(index);
}
void addAvailableDoubleSlot(uint32_t index) {
(void)doubleSlots.append(index);
mozilla::Unused << doubleSlots.append(index);
}
uint32_t allocateQuadSlot() {

View File

@ -46,6 +46,7 @@
#include "mozilla/Attributes.h"
#include "mozilla/ProcessHangMonitor.h"
#include "mozilla/UniquePtrExtensions.h"
#include "mozilla/unused.h"
#include "AccessCheck.h"
#include "nsGlobalWindow.h"
#include "nsAboutProtocolUtils.h"
@ -2664,7 +2665,7 @@ class JSMainRuntimeCompartmentsReporter final : public nsIMemoryReporter
? NS_LITERAL_CSTRING("js-main-runtime-compartments/system/")
: NS_LITERAL_CSTRING("js-main-runtime-compartments/user/"),
0);
(void)data->paths.append(path);
mozilla::Unused << data->paths.append(path);
}
NS_IMETHOD CollectReports(nsIMemoryReporterCallback* cb,

View File

@ -582,7 +582,9 @@ class NativeJSContainerImpl final
new NativeJSContainerImpl(instance.Env(), mJSContext, object));
ObjectBase::AttachNative(instance, mozilla::Move(impl));
mChildren.append(NativeJSObject::GlobalRef(instance));
if (!mChildren.append(NativeJSObject::GlobalRef(instance))) {
MOZ_CRASH();
}
return instance;
}