Follow up fix for bug 623435. (r=brendan)
authorChris Leary <cdleary@mozilla.com>
Tue, 25 Jan 2011 17:16:38 -0800
changeset 61437 4bc54aa1e5660099bae879c1e6bf6c8c1e938d47
parent 61436 a23e97df1b9fed3ed60997cc70c1ef2982443498
child 61438 3489b017fd2a9f7766fb5b3f075ca1287dad5cdc
push idunknown
push userunknown
push dateunknown
reviewersbrendan
bugs623435
milestone2.0b10pre
Follow up fix for bug 623435. (r=brendan)
js/src/jsregexp.cpp
--- a/js/src/jsregexp.cpp
+++ b/js/src/jsregexp.cpp
@@ -247,16 +247,17 @@ RegExp::handlePCREError(JSContext *cx, i
     }
 #undef REPORT
 }
 
 bool
 RegExp::parseFlags(JSContext *cx, JSString *flagStr, uintN *flagsOut)
 {
     size_t n = flagStr->length();
+    Anchor<JSString *> afs(flagStr);
     const jschar *s = flagStr->getChars(cx);
     if (!s)
         return false;
 
     *flagsOut = 0;
     for (size_t i = 0; i < n; i++) {
 #define HANDLE_FLAG(name_)                                                    \
         JS_BEGIN_MACRO                                                        \