Warning patrol. No bug, r=terrence

--HG--
extra : rebase_source : 9703c54a2dd87018af98c727c318036c4df846a2
This commit is contained in:
Jeff Walden 2012-06-11 17:17:19 -07:00
parent 7ae666a35f
commit 8723eff2c2
17 changed files with 37 additions and 31 deletions

View File

@ -284,7 +284,7 @@ CompileRegExpObject(JSContext *cx, RegExpObjectBuilder &builder, CallArgs args)
RegExpStatics *res = cx->regExpStatics();
RegExpObject *reobj = builder.build(escapedSourceStr, RegExpFlag(flags | res->getFlags()));
if (!reobj)
return NULL;
return false;
args.rval() = ObjectValue(*reobj);
return true;

View File

@ -274,7 +274,7 @@ frontend::CompileFunctionBody(JSContext *cx, JSFunction *fun,
TreeContext funtc(&parser, &funsc);
if (!funtc.init())
return NULL;
return false;
BytecodeEmitter funbce(&parser, &funsc, lineno,
/* noScriptRval = */ false, /* needsScriptGlobal = */ false);

View File

@ -489,7 +489,7 @@ class AutoEnterCompartmentAndPushPrincipal : public JSAutoEnterCompartment
if (cb->pushContextPrincipal)
return cb->pushContextPrincipal(cx, target->principals(cx));
return true;
};
}
~AutoEnterCompartmentAndPushPrincipal() {
// Pop the principal if necessary.
@ -499,7 +499,7 @@ class AutoEnterCompartmentAndPushPrincipal : public JSAutoEnterCompartment
if (cb->popContextPrincipal)
cb->popContextPrincipal(ac->context);
}
};
}
};

View File

@ -1441,13 +1441,17 @@ class AutoLockGC
class AutoUnlockGC {
private:
#ifdef JS_THREADSAFE
JSRuntime *rt;
#endif
JS_DECL_USE_GUARD_OBJECT_NOTIFIER
public:
explicit AutoUnlockGC(JSRuntime *rt
JS_GUARD_OBJECT_NOTIFIER_PARAM)
#ifdef JS_THREADSAFE
: rt(rt)
#endif
{
JS_GUARD_OBJECT_NOTIFIER_INIT;
JS_UNLOCK_GC(rt);

View File

@ -285,7 +285,7 @@ Snapshot(JSContext *cx, JSObject *obj_, unsigned flags, AutoIdVector *props)
{
IdSet ht(cx);
if (!ht.init(32))
return NULL;
return false;
RootedObject obj(cx, obj_), pobj(cx);
pobj = obj;

View File

@ -156,7 +156,7 @@ obj_setProto(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, Value
static bool
MarkSharpObjects(JSContext *cx, HandleObject obj, JSIdArray **idap, JSSharpInfo *value)
{
JS_CHECK_RECURSION(cx, return NULL);
JS_CHECK_RECURSION(cx, return false);
JSIdArray *ida;
@ -2555,7 +2555,7 @@ JSObject::sealOrFreeze(JSContext *cx, ImmutabilityType it)
last = cx->propertyTree().getChild(cx, last, self->numFixedSlots(), child);
if (!last)
return NULL;
return false;
}
JS_ASSERT(self->lastProperty()->slotSpan() == last->slotSpan());

View File

@ -1851,14 +1851,14 @@ IsVarSlot(JSPrinter *jp, jsbytecode *pc, JSAtom **varAtom, int *localSlot)
{
if (JOF_OPTYPE(*pc) == JOF_SCOPECOORD) {
*varAtom = ScopeCoordinateName(jp->sprinter.context->runtime, jp->script, pc);
LOCAL_ASSERT_RV(*varAtom, NULL);
LOCAL_ASSERT_RV(*varAtom, false);
return true;
}
unsigned slot = GET_SLOTNO(pc);
if (slot < jp->script->nfixed) {
*varAtom = GetArgOrVarAtom(jp, jp->fun->nargs + slot);
LOCAL_ASSERT_RV(*varAtom, NULL);
LOCAL_ASSERT_RV(*varAtom, false);
return true;
}

View File

@ -1192,7 +1192,7 @@ Proxy::fun_toString(JSContext *cx, JSObject *proxy, unsigned indent)
bool
Proxy::regexp_toShared(JSContext *cx, JSObject *proxy, RegExpGuard *g)
{
JS_CHECK_RECURSION(cx, return NULL);
JS_CHECK_RECURSION(cx, return false);
AutoPendingProxyOperation pending(cx, proxy);
return GetProxyHandler(proxy)->regexp_toShared(cx, proxy, g);
}
@ -1200,7 +1200,7 @@ Proxy::regexp_toShared(JSContext *cx, JSObject *proxy, RegExpGuard *g)
bool
Proxy::defaultValue(JSContext *cx, JSObject *proxy, JSType hint, Value *vp)
{
JS_CHECK_RECURSION(cx, return NULL);
JS_CHECK_RECURSION(cx, return false);
AutoPendingProxyOperation pending(cx, proxy);
return GetProxyHandler(proxy)->defaultValue(cx, proxy, hint, vp);
}
@ -1208,7 +1208,7 @@ Proxy::defaultValue(JSContext *cx, JSObject *proxy, JSType hint, Value *vp)
bool
Proxy::iteratorNext(JSContext *cx, JSObject *proxy, Value *vp)
{
JS_CHECK_RECURSION(cx, return NULL);
JS_CHECK_RECURSION(cx, return false);
AutoPendingProxyOperation pending(cx, proxy);
return GetProxyHandler(proxy)->iteratorNext(cx, proxy, vp);
}

View File

@ -129,7 +129,7 @@ Bindings::add(JSContext *cx, HandleAtom name, BindingKind kind)
UnownedBaseShape *nbase = BaseShape::getUnowned(cx, base);
if (!nbase)
return NULL;
return false;
StackShape child(nbase, id, slot, 0, attrs, Shape::HAS_SHORTID, *indexp);

View File

@ -2023,7 +2023,7 @@ BuildDollarReplacement(JSContext *cx, JSString *textstrArg, JSLinearString *reps
{
Rooted<JSLinearString*> textstr(cx, textstrArg->ensureLinear(cx));
if (!textstr)
return NULL;
return false;
JS_ASSERT(repstr->chars() <= firstDollar && firstDollar < repstr->chars() + repstr->length());
size_t matchStart = fm.match();

View File

@ -611,10 +611,10 @@ static const JSC::MacroAssembler::RegisterID JSParamReg_Argc = JSC::MIPSRegiste
pc, pinlined, fd); \
}
STUB_CALL_TYPE(JSObjStub);
STUB_CALL_TYPE(VoidPtrStubUInt32);
STUB_CALL_TYPE(VoidStubUInt32);
STUB_CALL_TYPE(VoidStub);
STUB_CALL_TYPE(JSObjStub)
STUB_CALL_TYPE(VoidPtrStubUInt32)
STUB_CALL_TYPE(VoidStubUInt32)
STUB_CALL_TYPE(VoidStub)
#undef STUB_CALL_TYPE

View File

@ -5124,7 +5124,7 @@ mjit::Compiler::testSingletonPropertyTypes(FrameEntry *top, HandleId id, bool *t
RootedObject proto(cx);
if (!js_GetClassPrototype(cx, globalObj, key, proto.address(), NULL))
return NULL;
return false;
return testSingletonProperty(proto, id);
}

View File

@ -202,10 +202,11 @@ ReportException(JSContext *cx)
}
}
class ToStringHelper {
class ToStringHelper
{
public:
ToStringHelper(JSContext *aCx, jsval v, bool aThrow = false)
: cx(aCx), mThrow(aThrow)
: cx(aCx)
{
mStr = JS_ValueToString(cx, v);
if (!aThrow && !mStr)
@ -225,7 +226,6 @@ class ToStringHelper {
private:
JSContext *cx;
JSString *mStr;
bool mThrow;
JSAutoByteString mBytes;
};

View File

@ -486,7 +486,7 @@ ReferenceFinder::addReferrer(jsval referrer_, Path *path)
Rooted<jsval> referrer(context, referrer_);
if (!context->compartment->wrap(context, referrer.address()))
return NULL;
return false;
char *pathName = path->computeName(context);
if (!pathName)

View File

@ -119,8 +119,8 @@ ValueToIdentifier(JSContext *cx, const Value &v, jsid *idp)
* Debugger::removeDebuggeeGlobal to make sure only current debuggers have Frame
* objects with .live === true.
*/
class Debugger::FrameRange {
JSContext *cx;
class Debugger::FrameRange
{
StackFrame *fp;
/* The debuggers in |fp|'s compartment, or NULL if there are none. */
@ -150,8 +150,9 @@ class Debugger::FrameRange {
* Similarly, if stack frames are added to or removed from frontDebugger(),
* then the range's front is invalid until popFront is called.
*/
FrameRange(JSContext *cx, StackFrame *fp, GlobalObject *global = NULL)
: cx(cx), fp(fp) {
FrameRange(StackFrame *fp, GlobalObject *global = NULL)
: fp(fp)
{
nextDebugger = 0;
/* Find our global, if we were not given one. */
@ -510,7 +511,7 @@ Debugger::slowPathOnLeaveFrame(JSContext *cx, bool frameOk)
/* Build a list of the recipients. */
AutoObjectVector frames(cx);
for (FrameRange r(cx, fp, global); !r.empty(); r.popFront()) {
for (FrameRange r(fp, global); !r.empty(); r.popFront()) {
if (!frames.append(r.frontFrame())) {
cx->clearPendingException();
return false;
@ -565,7 +566,7 @@ Debugger::slowPathOnLeaveFrame(JSContext *cx, bool frameOk)
* debugger's onPop handler could have caused another debugger to create its
* own Debugger.Frame instance.
*/
for (FrameRange r(cx, fp, global); !r.empty(); r.popFront()) {
for (FrameRange r(fp, global); !r.empty(); r.popFront()) {
JSObject *frameobj = r.frontFrame();
Debugger *dbg = r.frontDebugger();
JS_ASSERT(dbg == Debugger::fromChildJSObject(frameobj));
@ -1174,7 +1175,7 @@ Debugger::onSingleStep(JSContext *cx, Value *vp)
* onStep handlers.
*/
AutoObjectVector frames(cx);
for (FrameRange r(cx, fp); !r.empty(); r.popFront()) {
for (FrameRange r(fp); !r.empty(); r.popFront()) {
JSObject *frame = r.frontFrame();
if (!frame->getReservedSlot(JSSLOT_DEBUGFRAME_ONSTEP_HANDLER).isUndefined() &&
!frames.append(frame))

View File

@ -950,7 +950,7 @@ ContextStack::pushExecuteFrame(JSContext *cx, JSScript *script, const Value &thi
unsigned nvars = 2 /* callee, this */ + VALUES_PER_STACK_FRAME + script->nslots;
Value *firstUnused = ensureOnTop(cx, REPORT_ERROR, nvars, extend, &efg->pushedSeg_);
if (!firstUnused)
return NULL;
return false;
StackFrame *prev = evalInFrame ? evalInFrame : maybefp();
StackFrame *fp = reinterpret_cast<StackFrame *>(firstUnused + 2);

View File

@ -585,6 +585,7 @@ class JSShortString : public JSInlineString
offsetof(JSShortString, d.inlineStorage)) / sizeof(jschar));
}
protected: /* to fool clang into not warning this is unused */
jschar inlineStorageExtension[INLINE_EXTENSION_CHARS];
public: