summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/TAO_IDL')
-rw-r--r--TAO/TAO_IDL/ast/ast_module.cpp24
-rw-r--r--TAO/TAO_IDL/be/be_codegen.cpp3
-rw-r--r--TAO/TAO_IDL/be/be_enum.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_helper.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_interface.cpp2
-rw-r--r--TAO/TAO_IDL/be_include/be_helper.h2
-rw-r--r--TAO/TAO_IDL/tao_idl.mpc3
7 files changed, 28 insertions, 10 deletions
diff --git a/TAO/TAO_IDL/ast/ast_module.cpp b/TAO/TAO_IDL/ast/ast_module.cpp
index 8aa701b65d0..316c40a5736 100644
--- a/TAO/TAO_IDL/ast/ast_module.cpp
+++ b/TAO/TAO_IDL/ast/ast_module.cpp
@@ -775,12 +775,28 @@ AST_Module::fe_add_interface_fwd (AST_InterfaceFwd *i)
if (i->added () == 0)
{
- i->set_added (1);
+ i->set_added (true);
this->add_to_scope (i);
}
-
- // @@ Redefinition of forward. Type check not implemented.
-// i->set_full_definition (itf); // @@ Memory leak.
+
+ // If the lookup found the full_definition member of another
+ // interface_fwd, don't reset this full_definition. Otherwise
+ // reset the member and set is_defined_ on i so it itf won't
+ // get destroyed twice.
+ if (itf->is_defined ())
+ {
+ if (!i->is_defined ())
+ {
+ AST_Interface *prev_fd = i->full_definition ();
+ prev_fd->destroy ();
+ // No need to delete prev_fd, the call to
+ // set_full_definition() below will do it.
+ }
+
+ i->set_full_definition (itf);
+ i->set_as_defined ();
+ }
+
return i;
}
diff --git a/TAO/TAO_IDL/be/be_codegen.cpp b/TAO/TAO_IDL/be/be_codegen.cpp
index 9b3ac2fb971..bc031e8d87c 100644
--- a/TAO/TAO_IDL/be/be_codegen.cpp
+++ b/TAO/TAO_IDL/be/be_codegen.cpp
@@ -2543,10 +2543,7 @@ TAO_CodeGen::destroy (void)
delete this->server_inline_;
delete this->anyop_source_;
delete this->anyop_header_;
-#if !defined (linux) && !defined (__QNX__) && !defined (__GLIBC__)
- // This causes a seg fault on Linux RH 5.1. Let it leak . . .
delete this->gperf_input_stream_;
-#endif /* ! linux */
delete [] this->gperf_input_filename_;
this->curr_os_ = 0;
}
diff --git a/TAO/TAO_IDL/be/be_enum.cpp b/TAO/TAO_IDL/be/be_enum.cpp
index 7471d529168..0d1cd40065e 100644
--- a/TAO/TAO_IDL/be/be_enum.cpp
+++ b/TAO/TAO_IDL/be/be_enum.cpp
@@ -84,7 +84,7 @@ be_enum::gen_ostream_operator (TAO_OutStream *os)
UTL_ScopedName *mname =
this->value_to_name (static_cast<unsigned long> (i));
- *os << "case " << i << ": return strm << \""
+ *os << "case " << mname << ": return strm << \""
<< mname << "\";" << be_nl;
}
diff --git a/TAO/TAO_IDL/be/be_helper.cpp b/TAO/TAO_IDL/be/be_helper.cpp
index 2fd7dd18aab..b3307e87c49 100644
--- a/TAO/TAO_IDL/be/be_helper.cpp
+++ b/TAO/TAO_IDL/be/be_helper.cpp
@@ -147,7 +147,7 @@ TAO_OutStream::stream_type (void)
// Return the underlying lowlevel file pointer.
// indentation.
-FILE *
+FILE *&
TAO_OutStream::file (void)
{
return this->fp_;
diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp
index 31eeaf19780..bd6dc2a82f9 100644
--- a/TAO/TAO_IDL/be/be_interface.cpp
+++ b/TAO/TAO_IDL/be/be_interface.cpp
@@ -1711,6 +1711,8 @@ be_interface::gen_gperf_lookup_methods (const char *flat_name)
"fclose"),
-1);
}
+ // And reset file to 0 because otherwise there is a problem during destruction of stream.
+ tao_cg->gperf_input_stream ()->file () = 0;
// Open the temp file.
#if defined (ACE_OPENVMS)
diff --git a/TAO/TAO_IDL/be_include/be_helper.h b/TAO/TAO_IDL/be_include/be_helper.h
index 99d5b096063..e0d7253e035 100644
--- a/TAO/TAO_IDL/be_include/be_helper.h
+++ b/TAO/TAO_IDL/be_include/be_helper.h
@@ -127,7 +127,7 @@ public:
TAO_OutStream::STREAM_TYPE stream_type (void);
// return the stream type
- FILE *file (void);
+ FILE *&file (void);
// Return the underlying lowlevel file pointer.
int incr_indent (unsigned short flag = 1);
diff --git a/TAO/TAO_IDL/tao_idl.mpc b/TAO/TAO_IDL/tao_idl.mpc
index 3a1eec7bcc0..232a217f66f 100644
--- a/TAO/TAO_IDL/tao_idl.mpc
+++ b/TAO/TAO_IDL/tao_idl.mpc
@@ -87,6 +87,7 @@ project(TAO_IDL_EXE) : aceexe, install, tao_output, crosscompile, mcpp, tao_idl_
libs += TAO_IDL_BE TAO_IDL_FE
exeout = $(ACE_ROOT)/bin
after += TAO_IDL_BE TAO_IDL_FE gperf
+ includes += $(TAO_ROOT)
specific (automake) {
includes += $(srcdir)/include $(srcdir)/be_include $(srcdir)/fe $(TAO_ROOT)
@@ -131,6 +132,7 @@ project(TAO_IDL_BE) : acelib, conv_lib, tao_output, crosscompile, tao_vc8warning
libs += TAO_IDL_FE
dynamicflags = TAO_IDL_BE_BUILD_DLL
after += TAO_IDL_FE
+ includes += $(TAO_ROOT)
specific (automake) {
includes += $(srcdir)/include $(srcdir)/be_include $(srcdir)/fe
@@ -159,6 +161,7 @@ project(TAO_IDL_BE) : acelib, conv_lib, tao_output, crosscompile, tao_vc8warning
project(TAO_IDL_FE) : acelib, conv_lib, tao_output, crosscompile, fe_mcpp {
sharedname = TAO_IDL_FE
dynamicflags = TAO_IDL_FE_BUILD_DLL
+ includes += $(TAO_ROOT)
specific (automake) {
includes += $(srcdir)/include $(srcdir)/fe