Bug 3819

Summary: tao_idl crashes for multiple forward declarations of valuetypes
Product: TAO Reporter: Vladimir Zykov <vladimir.zykov>
Component: IDL CompilerAssignee: Vladimir Zykov <vladimir.zykov>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 1.7.6   
Hardware: All   
OS: All   
Attachments: A test case
A fix

Description Vladimir Zykov 2010-02-01 04:57:45 CST
Following code crashes tao_idl:

module orange {
    module apple {
        valuetype Foo;
        valuetype Foo;
    };
};

Xref: Scarab TAO#794.

Same applies to forward declarations of components and eventtypes. Plus for eventtypes tao_idl complains 'illegal redefinition "BazConsumer" and "BazConsumer"' but I didn't investigate the later deeply.
Comment 1 Vladimir Zykov 2010-02-01 05:02:50 CST
Created attachment 1247 [details]
A test case
Comment 2 Vladimir Zykov 2010-02-01 05:03:53 CST
Created attachment 1248 [details]
A fix
Comment 3 Johnny Willemsen 2010-02-02 04:45:45 CST
added dep
Comment 4 Johnny Willemsen 2010-02-02 04:48:15 CST
removed dep
Comment 5 Johnny Willemsen 2010-02-02 04:48:47 CST
Jeff is working on a branch with much more changes for TAO_IDL, can you add the test, we will merge jeff's branch in 2 days or so
Comment 6 Vladimir Zykov 2010-02-02 07:13:44 CST
(In reply to comment #5)
> Jeff is working on a branch with much more changes for TAO_IDL, can you add the
> test, we will merge jeff's branch in 2 days or so
> 

What is the best place for this test? TAO/tests/Bug_3819_Regression or TAO/tests/IDL_Test?
Comment 7 Johnny Willemsen 2010-02-02 08:04:44 CST
idl_test seems fine
Comment 8 Vladimir Zykov 2010-02-02 08:21:23 CST
(In reply to comment #7)
> idl_test seems fine
> 

Yes, to me it's also a better place but this will paint the scoreboard red until tao_idl is fixed... Hold on but the same will happen if I put it in a separate directory. :)
Comment 9 Johnny Willemsen 2010-02-02 08:57:06 CST
ok, can you hold the test for 2 days, I will let you know when Jeff's changes are in? Can you add at the same moment the fixes for the other types that don't work? The more tests, the better
Comment 10 Johnny Willemsen 2010-02-03 02:02:27 CST
can you already add the IDL to the repository?
Comment 11 Vladimir Zykov 2010-02-03 03:54:25 CST
In revision 88815.

Wed Feb  3 09:52:47 UTC 2010  Vladimir Zykov  <vladimir.zykov@prismtech.com>

        * tests/IDL_Test/IDL_Test.mpc:
        * tests/IDL_Test/Bug_3819_Regression.idl:
          Added a test for bug#3819.
Comment 12 Vladimir Zykov 2010-02-04 08:22:32 CST
In revision 88851.

Thu Feb  4 14:13:32 UTC 2010  Vladimir Zykov  <vladimir.zykov@prismtech.com>

        * TAO_IDL/be/be_visitor_union/discriminant_ci.cpp:
          Changed code to generate octal numbers where they are meant instead
          of decimals. Removed code for wchars since wchar discriminant is
          not allowed in unions.

        * TAO_IDL/be/be_global.cpp:
          Fixed a memory leak in tao_idl.

        * TAO_IDL/ast/ast_module.cpp:
          Fixed bug#3819. Multiple forward declarations of valuetypes,  
          eventtypes, and components don't crash tao_idl now.