Bug 1102636 - Unwrap objects before returning their address in objectAddress (r=sfink)
authorBill McCloskey <wmccloskey@mozilla.com>
Thu, 18 Dec 2014 17:34:24 -0800
changeset 246353 aefbe199f9a39386d3a98882901eda969d25956b
parent 246352 c3d759a3ba93036370494362be6728ddc3a5e92d
child 246354 c68a69cdae8a582d922ea2a15d242007e602cfb0
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1102636
milestone37.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 1102636 - Unwrap objects before returning their address in objectAddress (r=sfink)
js/src/builtin/TestingFunctions.cpp
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -1719,18 +1719,19 @@ ObjectAddress(JSContext *cx, unsigned ar
         RootedObject callee(cx, &args.callee());
         ReportUsageError(cx, callee, "Expected object");
         return false;
     }
 
 #ifdef JS_MORE_DETERMINISTIC
     args.rval().setInt32(0);
 #else
+    void *ptr = js::UncheckedUnwrap(&args[0].toObject(), true);
     char buffer[64];
-    JS_snprintf(buffer, sizeof(buffer), "%p", &args[0].toObject());
+    JS_snprintf(buffer, sizeof(buffer), "%p", ptr);
 
     JSString *str = JS_NewStringCopyZ(cx, buffer);
     if (!str)
         return false;
 
     args.rval().setString(str);
 #endif