View previous topic :: View next topic |
Author |
Message |
Don Clugston
Joined: 05 Oct 2005 Posts: 91 Location: Germany (expat Australian)
|
Posted: Mon Jan 02, 2006 10:09 am Post subject: bless bug with nested classes |
|
|
Displays "Error: Unknown type encountered in signature 'Ç'".
when using a nested class inside a template. Sorry I haven't narrowed it down. The error was occuring in the DynamicLibrary.d
To replicate:
In dynamiclibrary.d replace the one-parameter Ctor with the code below. and compile linktest1.
The "insitu" works OK though, seems to be just a bless problem.
Code: | template getCtor(TInterface, char [] classname) {
TInterface delegate() getCtor() {
class InternalClass {
ClassInfo typeClass;
Object function(Object) rawCtor;
this(ClassInfo inf, Object function(Object) func) {
typeClass=inf;
rawCtor = func;
}
TInterface internalCtor() {
auto a = _d_newclass(typeClass);
rawCtor(a);
return cast(TInterface)a;
}
}
InternalClass b = new InternalClass(getClassInfo!(classname)(),
cast(Object function (Object)) getExport(
"_D" ~ mangleSymbolName!(classname) ~ mangleSymbolName!("_ctor")
~ "F"
~ "ZC" ~ mangleSymbolName!(classname)).address
);
return &b.internalCtor;
} |
|
|
Back to top |
|
|
pragma
Joined: 28 May 2004 Posts: 607 Location: Washington, DC
|
|
Back to top |
|
|
pragma
Joined: 28 May 2004 Posts: 607 Location: Washington, DC
|
Posted: Mon Jan 02, 2006 6:19 pm Post subject: |
|
|
It looks like a demangler bug. I've seen it throw up on some templates, especially on the code generated by the compile-time regex engine. My guess is that its weak on templates that are specialized based on string constants.
The real test is to run ddlinfo on the suspect binary file, and again with the '-r' option. Using raw mode will pass, while forcing a demangle on the symbol info will fail like it did for bless.
In the meantime, I plan on modifying bless.d to not agressively demangle all symbols, as to head off any future problems with this. _________________ -- !Eric.t.Anderton at gmail |
|
Back to top |
|
|
pragma
Joined: 28 May 2004 Posts: 607 Location: Washington, DC
|
Posted: Tue Apr 18, 2006 8:54 pm Post subject: |
|
|
The ticket for this, #34, has been resolved.
I decided to use phobos' std.demangle implementation (now that it has one), so that I can keep in step with Walter's improvements as he goes about changing the spec. His code is much more efficent than what I had in demangle.d anyway.
http://trac.dsource.org/projects/ddl/ticket/34#preview _________________ -- !Eric.t.Anderton at gmail |
|
Back to top |
|
|
|