diff --git a/js/src/jsstr.cpp b/js/src/jsstr.cpp index 21bc01dbac90..d313a87cb5ff 100644 --- a/js/src/jsstr.cpp +++ b/js/src/jsstr.cpp @@ -2043,7 +2043,8 @@ FindReplaceLength(JSContext *cx, RegExpStatics *res, ReplaceData &rdata, size_t rdata.elembase = NULL; } - if (JSObject *lambda = rdata.lambda) { + if (rdata.lambda) { + RootedObject lambda(cx, rdata.lambda); PreserveRegExpStatics staticsGuard(cx, res); if (!staticsGuard.init(cx)) return false;