Bug 702466: Make sure we actually abort if we end up with unbalanced stacks. r=dbaron, a=dveditz GECKO19226_2012012406_RELBRANCH
authorJonas Sicking <jonas@sicking.cc>
Sat, 28 Jan 2012 16:23:12 -0800
branchGECKO19226_2012012406_RELBRANCH
changeset 35257 308e9289894d1526b8dec64625377929461b578e
parent 35256 2202afecc4e760fc12ca07a588e206793aa4bc2c
child 35259 18ac94cc350c3ee833f9769442ddf408fa9119b5
push id2017
push userdveditz@mozilla.com
push dateSun, 29 Jan 2012 00:42:24 +0000
reviewersdbaron, dveditz
bugs702466
milestone1.9.2.26
Bug 702466: Make sure we actually abort if we end up with unbalanced stacks. r=dbaron, a=dveditz
content/xslt/src/xslt/txStylesheetCompiler.cpp
--- a/content/xslt/src/xslt/txStylesheetCompiler.cpp
+++ b/content/xslt/src/xslt/txStylesheetCompiler.cpp
@@ -725,28 +725,32 @@ txStylesheetCompilerState::pushPtr(void*
     mTypeStack.AppendElement(aType);
     return mOtherStack.push(aPtr);
 }
 
 void*
 txStylesheetCompilerState::popPtr(enumStackType aType)
 {
     PRUint32 stacklen = mTypeStack.Length();
-    NS_ABORT_IF_FALSE(stacklen > 0,
-                      "Attempt to pop when type stack is empty\n");
+    if (stacklen == 0) {
+        NS_RUNTIMEABORT("Attempt to pop when type stack is empty");
+    }
+
     enumStackType type = mTypeStack.ElementAt(stacklen - 1);
     mTypeStack.RemoveElementAt(stacklen - 1);
     void* value = mOtherStack.pop();
     
 #ifdef TX_DEBUG_STACK
     PR_LOG(txLog::xslt, PR_LOG_DEBUG, ("popPtr: 0x%x type %u requested %u\n", value, type, aType));
 #endif
     
-    NS_ABORT_IF_FALSE(type == aType,
-                      "Expected type does not match top element type on stack");
+    if (type != aType) {
+        NS_RUNTIMEABORT("Expected type does not match top element type");
+    }
+
     return value;
 }
 
 nsresult
 txStylesheetCompilerState::addToplevelItem(txToplevelItem* aItem)
 {
     return mToplevelIterator.addBefore(aItem);
 }