Bug 995490 - Tracelogger: Don't assert for wrong textId on non-active items, r=till
authorHannes Verschore <hv1989@gmail.com>
Thu, 17 Apr 2014 12:26:25 +0200
changeset 179385 e07e0a07d0a5e6e4e7129dd041c7ea98628bfa6d
parent 179384 bd09a43b2b21dddce8f0f283dc099cdd209a434f
child 179386 62e295f8483e7309debf14b42d0fe24ed4860b9b
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewerstill
bugs995490
milestone31.0a1
Bug 995490 - Tracelogger: Don't assert for wrong textId on non-active items, r=till
js/src/vm/TraceLogging.cpp
js/src/vm/TraceLogging.h
--- a/js/src/vm/TraceLogging.cpp
+++ b/js/src/vm/TraceLogging.cpp
@@ -698,18 +698,18 @@ TraceLogger::startEvent(uint32_t id, uin
     return true;
 }
 
 void
 TraceLogger::stopEvent(uint32_t id)
 {
 #ifdef DEBUG
     TreeEntry entry;
-    MOZ_ASSERT(getTreeEntry(stack.current().treeId(), &entry));
-    MOZ_ASSERT(entry.textId() == id);
+    MOZ_ASSERT_IF(stack.current().active(), getTreeEntry(stack.current().treeId(), &entry));
+    MOZ_ASSERT_IF(stack.current().active(), entry.textId() == id);
 #endif
     stopEvent();
 }
 
 void
 TraceLogger::stopEvent()
 {
     if (enabled && stack.current().active()) {
--- a/js/src/vm/TraceLogging.h
+++ b/js/src/vm/TraceLogging.h
@@ -301,17 +301,17 @@ class TraceLogger
         }
         void setStart(uint64_t start) {
             start_ = start;
         }
         void setStop(uint64_t stop) {
             stop_ = stop;
         }
         void setTextId(uint32_t textId) {
-            MOZ_ASSERT(textId < (1<<31) );
+            MOZ_ASSERT(textId < uint32_t(1<<31) );
             u.s.textId_ = textId;
         }
         void setHasChildren(bool hasChildren) {
             u.s.hasChildren_ = hasChildren;
         }
         void setNextId(uint32_t nextId) {
             nextId_ = nextId;
         }
@@ -347,17 +347,17 @@ class TraceLogger
         }
         void setTreeId(uint32_t treeId) {
             treeId_ = treeId;
         }
         void setLastChildId(uint32_t lastChildId) {
             lastChildId_ = lastChildId;
         }
         void setTextId(uint32_t textId) {
-            MOZ_ASSERT(textId < (1<<31) );
+            MOZ_ASSERT(textId < uint32_t(1<<31) );
             s.textId_ = textId;
         }
         void setActive(bool active) {
             s.active_ = active;
         }
     };
 
     // The layout of the event log in memory and in the log file.