[omniORB] omniidl2 bug ?????

Douglas Kosovic douglask@dstc.edu.au
Mon, 21 Jun 1999 11:30:06 +1000


Hi,

A patch for omniORB-2.7.1's omniidl2 which fixes the ObjectRef/typedef
bug for exception members can be found at the end of this email.

For example, if omniidl2 tries to compile the follwing IDL, a core
dump will occur:
 
   interface RefObject;
 
   typedef RefObject DesignatorType;
 
   exception InvalidDesignator {
     DesignatorType designator;  //the trouble-maker line!
   };
 
   interface RefObject {
     attribute boolean foo;
  };

The exception member patch is based on how omniidl2 handles typedef
ObjectRefs as IDL union members.

Doug.


*** src/tool/omniidl2/omniORB2_be/o2be_exception.cc	Mon Jun 21 10:31:39 1999
--- newsrc/tool/omniidl2/omniORB2_be/o2be_exception.cc	Mon Jun 21 10:39:02 1999
***************
*** 257,262 ****
--- 257,265 ----
  
        switch (ntype) {
        case o2be_operation::tObjref:
+ 	while (decl->node_type() == AST_Decl::NT_typedef) {
+ 	  decl = o2be_typedef::narrow_from_decl(decl)->base_type();
+ 	}
  	s << o2be_interface::narrow_from_decl(decl)
  	  ->unambiguous_objref_name(this);
  	break;
***************
*** 464,469 ****
--- 467,475 ----
  	s << ((mapping.is_const) ? "const ":"");
  	switch (ntype) {
  	case o2be_operation::tObjref:
+ 	  while (decl->node_type() == AST_Decl::NT_typedef) {
+ 	    decl = o2be_typedef::narrow_from_decl(decl)->base_type();
+ 	  }
  	  s << o2be_interface::narrow_from_decl(decl)
  	    ->unambiguous_objref_name(this);
  	  break;