Bug 909866 - Fix an exact rooting hazard in JSCompartment::wrap; r=sfink

--HG--
extra : rebase_source : 637cea3f6c93a333bfe9000f0837663fd0905853
This commit is contained in:
Terrence Cole 2013-08-27 15:16:03 -07:00
parent 4aeeb65d91
commit c1259eea9d

View File

@ -54,8 +54,8 @@ JSCompartment::wrap(JSContext *cx, JS::MutableHandleValue vp, JS::HandleObject e
/* Handle strings. */
if (vp.isString()) {
JSString *str = vp.toString();
if (!wrap(cx, &str))
JS::RootedString str(cx, vp.toString());
if (!wrap(cx, str.address()))
return false;
vp.setString(str);
return true;