summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Hornsey <hornseyf@objectcomputing.com>2019-01-09 18:45:48 -0600
committerFred Hornsey <hornseyf@objectcomputing.com>2019-01-09 18:45:48 -0600
commitd122c6f05077d992b14d3b89b40efd74528c273c (patch)
treedc4de526ab529e7890867dcb6de502d1dbfd3a2e
parent4d428266b38547baf4d8f7c4c79b7ce811f28777 (diff)
downloadATCD-d122c6f05077d992b14d3b89b40efd74528c273c.tar.gz
tao_idl: Initial Fixes for Coverity
Everything except for the resource leaks
-rw-r--r--TAO/TAO_IDL/ast/ast_annotation_appl.cpp4
-rw-r--r--TAO/TAO_IDL/ast/ast_annotation_member.cpp2
-rw-r--r--TAO/TAO_IDL/ast/ast_enum_val.cpp3
-rw-r--r--TAO/TAO_IDL/util/idl_version.cpp15
4 files changed, 13 insertions, 11 deletions
diff --git a/TAO/TAO_IDL/ast/ast_annotation_appl.cpp b/TAO/TAO_IDL/ast/ast_annotation_appl.cpp
index 5dd5469d5db..d7cb3484bc1 100644
--- a/TAO/TAO_IDL/ast/ast_annotation_appl.cpp
+++ b/TAO/TAO_IDL/ast/ast_annotation_appl.cpp
@@ -2,7 +2,9 @@
#include "ast_annotation_member.h"
AST_Annotation_Appl::Param::Param ()
- : used (false)
+ : used (false),
+ id (0),
+ expr (0)
{
}
diff --git a/TAO/TAO_IDL/ast/ast_annotation_member.cpp b/TAO/TAO_IDL/ast/ast_annotation_member.cpp
index 2acba197bfb..40884ef5aae 100644
--- a/TAO/TAO_IDL/ast/ast_annotation_member.cpp
+++ b/TAO/TAO_IDL/ast/ast_annotation_member.cpp
@@ -63,7 +63,7 @@ void
AST_Annotation_Member::dump (ACE_OSTREAM_TYPE &o)
{
AST_Field::dump (o);
- if (value_)
+ if (field_type () && value_)
{
dump_i (o, " default ");
if (field_type ()->node_type () == AST_Decl::NT_enum)
diff --git a/TAO/TAO_IDL/ast/ast_enum_val.cpp b/TAO/TAO_IDL/ast/ast_enum_val.cpp
index c33e22c8040..eef74bb560a 100644
--- a/TAO/TAO_IDL/ast/ast_enum_val.cpp
+++ b/TAO/TAO_IDL/ast/ast_enum_val.cpp
@@ -79,7 +79,8 @@ AST_EnumVal::AST_EnumVal (ACE_CDR::ULong v,
AST_Constant (AST_Expression::EV_ulong,
AST_Decl::NT_enum_val,
new AST_Expression (v),
- n)
+ n),
+ enum_parent_ (0)
{
}
diff --git a/TAO/TAO_IDL/util/idl_version.cpp b/TAO/TAO_IDL/util/idl_version.cpp
index 14a70dc821c..2ab8a542b24 100644
--- a/TAO/TAO_IDL/util/idl_version.cpp
+++ b/TAO/TAO_IDL/util/idl_version.cpp
@@ -44,16 +44,15 @@ const char * IdlVersion::to_string () const
void IdlVersion::from_string (const char * version)
{
- if (!version)
+ if (version)
{
- version_ = IDL_VERSION_INVALID;
- }
- for (int i = 0; i < IDL_VERSION_COUNT; i++)
- {
- if (!ACE_OS::strcmp (version, idlVersionNames[i]))
+ for (int i = 0; i < IDL_VERSION_COUNT; i++)
{
- version_ = static_cast<SpecificIdlVersion> (i);
- return;
+ if (!ACE_OS::strcmp (version, idlVersionNames[i]))
+ {
+ version_ = static_cast<SpecificIdlVersion> (i);
+ return;
+ }
}
}
version_ = IDL_VERSION_INVALID;