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 220545 aefbe199f9a39386d3a98882901eda969d25956b
parent 220544 c3d759a3ba93036370494362be6728ddc3a5e92d
child 220546 c68a69cdae8a582d922ea2a15d242007e602cfb0
push id10503
push userryanvm@gmail.com
push dateFri, 19 Dec 2014 20:13:42 +0000
treeherderfx-team@98ee95ac6be5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1102636
milestone37.0a1
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