Bug 581473: Fix uninitialized variable warnings in XPCConvert::JSData2Native. r=mrbkap
authorAtul Aggarwal <atulagrwl@gmail.com>
Thu, 01 Sep 2011 01:06:48 +0530
changeset 78934 9b6d23e07968bbdf63224d9e25e535b6cd856067
parent 78933 184cfbecb1c322217e07fab4cfc0efffdfb93d6f
child 78935 95a1d14917c4638f3c3d634b9d94000f3848571b
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs581473
milestone9.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 581473: Fix uninitialized variable warnings in XPCConvert::JSData2Native. r=mrbkap
js/src/xpconnect/src/xpcconvert.cpp
--- a/js/src/xpconnect/src/xpcconvert.cpp
+++ b/js/src/xpconnect/src/xpcconvert.cpp
@@ -721,20 +721,20 @@ XPCConvert::JSData2Native(XPCCallContext
             isDOMString = JS_FALSE;
             // Fall through to T_DOMSTRING case.
         }
         case nsXPTType::T_DOMSTRING:
         {
             static const PRUnichar EMPTY_STRING[] = { '\0' };
             static const PRUnichar VOID_STRING[] = { 'u', 'n', 'd', 'e', 'f', 'i', 'n', 'e', 'd', '\0' };
 
-            const PRUnichar* chars;
+            const PRUnichar* chars = nsnull;
             JSString* str = nsnull;
             JSBool isNewString = JS_FALSE;
-            PRUint32 length;
+            PRUint32 length = 0;
 
             if(JSVAL_IS_VOID(s))
             {
                 if(isDOMString) 
                 {
                     chars  = VOID_STRING;
                     length = NS_ARRAY_LENGTH(VOID_STRING) - 1;
                 }