diff options
author | Mark Spruiell <mes@zeroc.com> | 2006-01-04 00:07:00 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2006-01-04 00:07:00 +0000 |
commit | dacfeacc4bc09438be4e02f68f862bc454091525 (patch) | |
tree | 224ec246f244513f3289c5ad321ca25956b1a418 /cpp/src | |
parent | noarch fixes (diff) | |
download | ice-dacfeacc4bc09438be4e02f68f862bc454091525.tar.bz2 ice-dacfeacc4bc09438be4e02f68f862bc454091525.tar.xz ice-dacfeacc4bc09438be4e02f68f862bc454091525.zip |
fix for null reference check in Dictionary.Equals
Diffstat (limited to 'cpp/src')
-rwxr-xr-x | cpp/src/slice2cs/Gen.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp index 1a7769c26ee..6eb86ff80ce 100755 --- a/cpp/src/slice2cs/Gen.cpp +++ b/cpp/src/slice2cs/Gen.cpp @@ -2819,15 +2819,25 @@ Slice::Gen::TypesVisitor::visitDictionary(const DictionaryPtr& p) _out << sb; if(!valueIsValue) { - _out << nl << "if(vlhs__[i] == null && vrhs__[i] != null)"; + _out << nl << "if(vlhs__[i] == null)"; + _out << sb; + _out << nl << "if(vrhs__[i] != null)"; + _out << sb; + _out << nl << "return false;"; + _out << eb; + _out << eb; + _out << nl << "else if(!vlhs__[i].Equals(vrhs__[i]))"; + _out << sb; + _out << nl << "return false;"; + _out << eb; + } + else + { + _out << nl << "if(!vlhs__[i].Equals(vrhs__[i]))"; _out << sb; _out << nl << "return false;"; _out << eb; } - _out << nl << "if(!vlhs__[i].Equals(vrhs__[i]))"; - _out << sb; - _out << nl << "return false;"; - _out << eb; _out << eb; _out << nl << "return true;"; _out << eb; |