Bug 840209: Make existing implicit char-conversion explicit (w/ assertion for sanity-checking), in txXPCOMExtensionFunction.cpp. r=peterv
authorDaniel Holbert <dholbert@cs.stanford.edu>
Mon, 18 Feb 2013 08:59:56 -0800
changeset 122246 ae60b8d343e5e23888d1ee4b35ad18f18f132416
parent 122245 4e92ba60695d675be9c797a5cb1dabd109bf2820
child 122247 33feebc4a09f1b3482ad1b7e76933b657d126093
push id24327
push usergszorc@mozilla.com
push dateTue, 19 Feb 2013 05:22:32 +0000
treeherdermozilla-central@e8f8a3f6f1f6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs840209
milestone21.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 840209: Make existing implicit char-conversion explicit (w/ assertion for sanity-checking), in txXPCOMExtensionFunction.cpp. r=peterv
content/xslt/src/xpath/txXPCOMExtensionFunction.cpp
--- a/content/xslt/src/xpath/txXPCOMExtensionFunction.cpp
+++ b/content/xslt/src/xpath/txXPCOMExtensionFunction.cpp
@@ -182,17 +182,21 @@ LookupFunction(const char *aContractID, 
     nsAutoCString methodName;
     PRUnichar letter;
     bool upperNext = false;
     while ((letter = *name)) {
         if (letter == '-') {
             upperNext = true;
         }
         else {
-            methodName.Append(upperNext ? nsCRT::ToUpper(letter) : letter);
+            MOZ_ASSERT(nsCRT::IsAscii(letter),
+                       "invalid static_cast coming up");
+            methodName.Append(upperNext ?
+                              nsCRT::ToUpper(static_cast<char>(letter)) :
+                              letter);
             upperNext = false;
         }
         ++name;
     }
 
     uint32_t i;
     for (i = 0; i < iidCount; ++i) {
         nsIID *iid = iidArray[i];