Bug 657710 - Fix strict aliasing warning (r=luke)
authorBill McCloskey <wmccloskey@mozilla.com>
Wed, 18 May 2011 10:23:08 -0700
changeset 69928 1c4b22465a5d
parent 69927 8c697ffd18f8
child 69929 183f04be1d45
push id20142
push usercleary@mozilla.com
push date2011-05-23 07:31 +0000
treeherdermozilla-central@0f9347d40121 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs657710
milestone6.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 657710 - Fix strict aliasing warning (r=luke)
js/src/jsapi.cpp
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -5528,17 +5528,18 @@ JS_EncodeStringToBuffer(JSString *str, c
 
 JS_PUBLIC_API(JSBool)
 JS_Stringify(JSContext *cx, jsval *vp, JSObject *replacer, jsval space,
              JSONWriteCallback callback, void *data)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, replacer, space);
     StringBuffer sb(cx);
-    if (!js_Stringify(cx, Valueify(vp), replacer, Valueify(space), sb))
+    Value spacev = Valueify(space);
+    if (!js_Stringify(cx, Valueify(vp), replacer, spacev, sb))
         return false;
     return callback(sb.begin(), sb.length(), data);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_TryJSON(JSContext *cx, jsval *vp)
 {
     CHECK_REQUEST(cx);