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 a12ca3e4e8
commit 639d62a891

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;