Discussion:
[omniORB] Two bugs in omniidl
Gellule Xg
2008-12-11 00:56:24 UTC
Permalink
The following small idl files reveals two bugs in omniidl 4.1.3 cxx
backend
Thanks for the bug report. I've fixed both. For the double constant bug
your proposed fix works. For the struct scope issue, the problem is
actually that the type lookup was failing to enter the struct scope so
it didn't notice the clash. Properly entering the scope means the type
is properly fully qualified in case of clashes.
Isn't the cxx backend having the type of problems with the following
IDL, where myM::myS and myM::myI::myS clash?

module myM {
struct myS {
boolean myB;
};
interface myI {
void myS();
void myC(in myM::myS myP};
};
};

I notice issues in the hh file:

void myC(const myS& myP);
==> void myC(const *myM::*myS& myP);

virtual void myC(const myS& myP) = 0;
==> virtual void myC(const *myM::*myS& myP) = 0;

and in the SK.cpp file:

void myM::_objref_myI::myC(const myS& myP)
==> void myM::_objref_myI::myC(const *myM::*myS& myP)

_call_desc.arg_0 = &(myS&) myP;
==> _call_desc.arg_0 = &(*myM::*myS&) myP;


Thanks,
Gellule Xg
2008-12-13 09:23:39 UTC
Permalink
Post by Gellule Xg
Isn't the cxx backend having the type of problems with the following
IDL, where myM::myS and myM::myI::myS clash?
module myM {
struct myS {
boolean myB;
};
interface myI {
void myS();
void myC(in myM::myS myP};
};
};
void myC(const myS& myP);
==> void myC(const *myM::*myS& myP);
virtual void myC(const myS& myP) = 0;
==> virtual void myC(const *myM::*myS& myP) = 0;
void myM::_objref_myI::myC(const myS& myP)
==> void myM::_objref_myI::myC(const *myM::*myS& myP)
_call_desc.arg_0 = &(myS&) myP;
==> _call_desc.arg_0 = &(*myM::*myS&) myP;
I've used the interactive mode of omniidl (-i option) and checked that
at least to that point things are alright. Parameter "myP" does show up
as having scoped named "myM::myS". Must be in the back-end...

After trial and error within the cxx back-end, I managed to make things
compile with the following patch. Don't know if I've broken anything
else. The logic for the change would be: the environment to use for a
method should include the containing interface.

-Gellule



Index: iface.py
===================================================================
RCS file:
/cvsroot/omniorb/omni/src/lib/omniORB/omniidl_be/cxx/Attic/iface.py,v
retrieving revision 1.1.6.15
diff -r1.1.6.15 iface.py
256c256
< environment = self.callable().interface().environment()
---
Post by Gellule Xg
environment =
self.callable().interface().environment().enter("_objref_"+self.callable().interface().name().simple())
691c691
< self._environment)
---
self._environment.enter(self.name().simple()))
Duncan Grisby
2008-12-30 00:05:20 UTC
Permalink
On Friday 12 December, Gellule Xg wrote:

[...]
Post by Gellule Xg
After trial and error within the cxx back-end, I managed to make
things compile with the following patch. Don't know if I've broken
anything else. The logic for the change would be: the environment to
use for a method should include the containing interface.
Thanks. Your patch is nearly there. You don't need to mangle the names
into the C++ mapped class names, though -- the original names from the
IDL are fine, and are important in nested scopes.

I've checked in a small variant of your patch.

Did you encounter this problem in real IDL, or is it test IDL designed
to provoke errors like this?

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Loading...