diff options
author | Benoit Foucher <benoit@zeroc.com> | 2015-02-20 14:27:41 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2015-02-20 14:27:41 +0100 |
commit | af1544e7b81e8708c5fdee05a59328558a3030fe (patch) | |
tree | 0933eb39159b8cf714aab7fe5901d0515674d7c6 /cpp/src/slice2freezej | |
parent | Simplification to Atomic usage (diff) | |
download | ice-af1544e7b81e8708c5fdee05a59328558a3030fe.tar.bz2 ice-af1544e7b81e8708c5fdee05a59328558a3030fe.tar.xz ice-af1544e7b81e8708c5fdee05a59328558a3030fe.zip |
Fix for ICE-6268, initialize enum, string and structs in Java/C#/Objective-C/JavaScript
Diffstat (limited to 'cpp/src/slice2freezej')
-rw-r--r-- | cpp/src/slice2freezej/Main.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/cpp/src/slice2freezej/Main.cpp b/cpp/src/slice2freezej/Main.cpp index a2b65ccbb22..ae6b1beaf87 100644 --- a/cpp/src/slice2freezej/Main.cpp +++ b/cpp/src/slice2freezej/Main.cpp @@ -939,6 +939,10 @@ FreezeGenerator::generate(UnitPtr& u, const Dict& dict) out << nl << "Patcher __p = new Patcher();"; patchParams = "__p"; } + else if(StructPtr::dynamicCast(type)) + { + out << nl << typeS << " __r = null;"; + } else { out << nl << typeS << " __r;"; @@ -1082,7 +1086,14 @@ FreezeGenerator::generate(UnitPtr& u, const Dict& dict) list<string> metaData; string patchParams; - out << nl << indexKeyTypeS << " r;"; + if(StructPtr::dynamicCast(indexTypes[i])) + { + out << nl << indexKeyTypeS << " r = null;"; + } + else + { + out << nl << indexKeyTypeS << " r;"; + } BuiltinPtr b = BuiltinPtr::dynamicCast(indexTypes[i]); if(b != 0) @@ -1737,7 +1748,7 @@ compile(int argc, char* argv[]) IceUtil::CtrlCHandler ctrlCHandler; ctrlCHandler.setCallback(interruptedCallback); - + if(dependxml) { cout << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<dependencies>" << endl; @@ -1811,7 +1822,7 @@ compile(int argc, char* argv[]) return EXIT_FAILURE; } } - + { IceUtilInternal::MutexPtrLock<IceUtil::Mutex> sync(globalMutex); @@ -1821,7 +1832,7 @@ compile(int argc, char* argv[]) } } } - + if(dependxml) { cout << "</dependencies>\n"; |