@@ -526,7 +526,7 @@ static bool str_escape(JSContext* cx, unsigned argc, Value* vp) {
526526 return true ;
527527 }
528528
529- JSString* res = newChars.toString (cx, newLength);
529+ JS::Rooted< JSString*> res (cx, newChars.toString (cx, newLength) );
530530 if (!res) {
531531 return false ;
532532 }
@@ -1969,7 +1969,7 @@ static bool str_normalize(JSContext* cx, unsigned argc, Value* vp) {
19691969 form = NormalizationForm::NFC;
19701970 } else {
19711971 // Step 4.
1972- JSLinearString* formStr = ArgToLinearString (cx, args, 0 );
1972+ JS::Rooted< JSLinearString*> formStr (cx, ArgToLinearString (cx, args, 0 ) );
19731973 if (!formStr) {
19741974 return false ;
19751975 }
@@ -3312,7 +3312,7 @@ static JSLinearString* TrimString(JSContext* cx, JSString* str, bool trimStart,
33123312 &end);
33133313 }
33143314
3315- JSLinearString* result = NewDependentString (cx, linear, begin, end - begin);
3315+ JS::Rooted< JSLinearString*> result (cx, NewDependentString (cx, linear, begin, end - begin) );
33163316
33173317 // TaintFox: Add trim operation to current taint flow.
33183318 // the acutal trimming of taint ranges has been done in
@@ -4293,7 +4293,7 @@ static ArrayObject* CharSplitHelper(JSContext* cx, Handle<JSLinearString*> str,
42934293
42944294 for (size_t i = 0 ; i < resultlen; ++i) {
42954295 // TaintFox: code modified to avoid atoms.
4296- JSString* sub = NewDependentString (cx, str, i, 1 );
4296+ JS::Rooted< JSString*> sub (cx, NewDependentString (cx, str, i, 1 ) );
42974297 // was:
42984298 // JSString* sub = staticStrings.getUnitStringForElement(cx, str, i);
42994299 if (!sub) {
0 commit comments