Bug 718293 - Anchor string in nsHTMLDocumentSH::CallToGetPropMapper. r=jorendorff
authorJames Kitchener <jkitch.bug@gmail.com>
Sat, 29 Sep 2012 12:32:56 -0400
changeset 108636 ecedd932c25bdaa2dd39a536139439441fd3ea01
parent 108635 6a5b311a12e636c40c6b9779eee6ebda2418701e
child 108637 be23db843f5075b9c4a6aeeda7bcb0fea5df49ba
push id23572
push userryanvm@gmail.com
push dateSun, 30 Sep 2012 03:39:23 +0000
treeherdermozilla-central@d0b325032484 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs718293
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 718293 - Anchor string in nsHTMLDocumentSH::CallToGetPropMapper. r=jorendorff
dom/base/nsDOMClassInfo.cpp
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -9169,16 +9169,17 @@ nsHTMLDocumentSH::CallToGetPropMapper(JS
     self = JSVAL_TO_OBJECT(JS_CALLEE(cx, vp));
   } else {
     self = JS_THIS_OBJECT(cx, vp);
     if (!self)
       return JS_FALSE;
   }
 
   size_t length;
+  JS::Anchor<JSString *> anchor(str);
   const jschar *chars = ::JS_GetStringCharsAndLength(cx, str, &length);
   if (!chars) {
     return JS_FALSE;
   }
 
   return ::JS_GetUCProperty(cx, self, chars, length, vp);
 }