Bug 707049 - Followup: fix accidentally introduced 'uint8's from js/src; r=sparky
authorMs2ger <ms2ger@gmail.com>
Mon, 02 Jan 2012 19:06:35 +0100
changeset 84876 e433daca145f6fba40167416016ff7d62a2ffaa5
parent 84875 941801e7439cf019790590c6e6d72a86a7b1f0c6
child 84877 50116672ff05465c5b9d737fc54e30defd76226f
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssparky
bugs707049
milestone12.0a1
Bug 707049 - Followup: fix accidentally introduced 'uint8's from js/src; r=sparky
js/src/jscntxt.h
js/src/jsgc.cpp
--- a/js/src/jscntxt.h
+++ b/js/src/jscntxt.h
@@ -1589,39 +1589,39 @@ typedef Root<jsid>               RootId;
 typedef Root<Value>              RootValue;
 
 /* Mark a stack location as a root for a rooting analysis. */
 class CheckRoot
 {
 #if defined(DEBUG) && defined(JSGC_ROOT_ANALYSIS)
 
     CheckRoot **stack, *prev;
-    const uint8 *ptr;
+    const uint8_t *ptr;
 
   public:
     template <typename T>
     CheckRoot(JSContext *cx, const T *ptr
               JS_GUARD_OBJECT_NOTIFIER_PARAM)
     {
         this->stack = &cx->checkGCRooters;
         this->prev = *stack;
         *stack = this;
-        this->ptr = (const uint8 *) ptr;
+        this->ptr = static_cast<const uint8_t*>(ptr);
         JS_GUARD_OBJECT_NOTIFIER_INIT;
     }
 
     ~CheckRoot()
     {
         JS_ASSERT(*stack == this);
         *stack = prev;
     }
 
     CheckRoot *previous() { return prev; }
 
-    bool contains(const uint8 *v, size_t len) {
+    bool contains(const uint8_t *v, size_t len) {
         return ptr >= v && ptr < v + len;
     }
 
 #else /* DEBUG && JSGC_ROOT_ANALYSIS */
 
   public:
     template <typename T>
     CheckRoot(JSContext *cx, const T *ptr
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -3415,17 +3415,17 @@ CheckStackRoot(JSTracer *trc, jsuword *w
                 while (rooter) {
                     if (rooter->address() == (Cell **) w)
                         matched = true;
                     rooter = rooter->previous();
                 }
             }
             CheckRoot *check = acx->checkGCRooters;
             while (check) {
-                if (check->contains((uint8 *) w, sizeof(w)))
+                if (check->contains(static_cast<uint8_t*>(w), sizeof(w)))
                     matched = true;
                 check = check->previous();
             }
         }
         if (!matched) {
             /*
              * Only poison the last byte in the word. It is easy to get
              * accidental collisions when a value that does not occupy a full