Bug 1403911 - Part 6: Don't atomize the pattern in str_replace_string_raw. r=jandem
authorAndré Bargull <andre.bargull@gmail.com>
Tue, 03 Oct 2017 16:11:07 +0200
changeset 426802 763b978156fa9833d5cc3673872b70b6b8d37216
parent 426801 3b00d68c8ef9d7eeb723289518a3e0380efad07a
child 426803 73df32fe6776fddb79774cc63317be1ca2bf4262
push id97
push userfmarier@mozilla.com
push dateSat, 14 Oct 2017 01:12:59 +0000
reviewersjandem
bugs1403911
milestone58.0a1
Bug 1403911 - Part 6: Don't atomize the pattern in str_replace_string_raw. r=jandem
js/src/jsstr.cpp
--- a/js/src/jsstr.cpp
+++ b/js/src/jsstr.cpp
@@ -2850,17 +2850,17 @@ js::str_flat_replace_string(JSContext *c
 JSString*
 js::str_replace_string_raw(JSContext* cx, HandleString string, HandleString pattern,
                            HandleString replacement)
 {
     RootedLinearString repl(cx, replacement->ensureLinear(cx));
     if (!repl)
         return nullptr;
 
-    RootedAtom pat(cx, AtomizeString(cx, pattern));
+    RootedLinearString pat(cx, pattern->ensureLinear(cx));
     if (!pat)
         return nullptr;
 
     size_t patternLength = pat->length();
     int32_t match;
     uint32_t dollarIndex;
 
     {