Bug 838955 (part 2) - Fix rooting hazards in jsstr.cpp identified by static analysis. r=sfink.

This commit is contained in:
Nicholas Nethercote
2013-02-07 18:13:41 -08:00
parent af9fbe4bb8
commit 847ffd45a0
9 changed files with 36 additions and 40 deletions

View File

@@ -2549,7 +2549,7 @@ date_toJSON(JSContext *cx, unsigned argc, Value *vp)
/* Step 2. */
RootedValue tv(cx, ObjectValue(*obj));
if (!ToPrimitive(cx, JSTYPE_NUMBER, tv.address()))
if (!ToPrimitive(cx, JSTYPE_NUMBER, &tv))
return false;
/* Step 3. */
@@ -3052,7 +3052,7 @@ js_Date(JSContext *cx, unsigned argc, Value *vp)
/* ES5 15.9.3.2. */
/* Step 1. */
if (!ToPrimitive(cx, &args[0]))
if (!ToPrimitive(cx, args.handleAt(0)))
return false;
if (args[0].isString()) {