Thread overview |
---|
December 25, 2006 [Issue 735] New: dmd segfault | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=735 Summary: dmd segfault Product: D Version: 0.178 Platform: PC OS/Version: Windows Status: NEW Severity: normal Priority: P1 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: davidl@126.com testmain.d import modulefault; interface ITestClass { void callable(); } void main() { auto testLibrary = new testclass; auto testCtor = testLibrary.getCtor!(ITestClass,"test.testmodule.TestClass")(); } modulefault.d struct mystruct { char[] mystring; void opCall(char[] hello) { mystring = hello; } public void* address; } class testclass{ template getCtor(TInterface, char[] classname,T...) { static ClassInfo typeClass; static Object function (T, Object) rawCtor; static TInterface internalCtor(T t) { auto a = _d_newclass(typeClass); rawCtor(t, a); return cast(TInterface)a; } TInterface function(T) getCtor() { typeClass = getClassInfo!(classname)(); char[] localchar; foreach(a;T) { localchar~=a.mangleof; } rawCtor = cast(Object function (T, Object)) getSymbol( "_D" ~ mangleSymbolName!(classname) ~ mangleSymbolName!("_ctor") ~ "F" ~ localchar ~ "ZC" ~ mangleSymbolName!(classname)).address; return &internalCtor; } } template getClassInfo(char[] classname){ ClassInfo getClassInfo(){ return cast(ClassInfo)getSymbol("__Class_").address; } } mystruct getSymbol(char[] hello) { return mystruct(hello); } } notice: any grammar mistake in getClassInfo would still trigger this segfault so i guess the problem is in the parser -- |
December 25, 2006 Re: [Issue 735] New: dmd segfault | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail Attachments: | d-bugmail@puremagic.com schrieb am 2006-12-25: > http://d.puremagic.com/issues/show_bug.cgi?id=735 <snip> > notice: any grammar mistake in getClassInfo would still trigger this segfault so i guess the problem is in the parser David please follow the common bug reporting guidelines outlined at http://www.digitalmars.com/bugs.html and http://www.prowiki.org/wiki4d/wiki.cgi?D__Tutorial/BugReports reducing your code results in 4 lines that reliable reproduce the bug: # # template getCtor(T...){ # void function(T, int) x; # } # # mixin getCtor!(); # Thomas |
February 13, 2007 [Issue 735] forward reference to type Object?? | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=735 davidl@126.com changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |critical Summary|dmd segfault |forward reference to type | |Object?? Version|0.178 |1.005 ------- Comment #3 from davidl@126.com 2007-02-12 20:41 ------- err, dmd not segfault any more, but if i add the following to modulefault.d to make it compile : extern(D) Object _d_newclass(ClassInfo a); dmd throws me: modulefault.d(16): Error: forward reference to type Object modulefault.d(16): Error: cannot implicitly convert expression (a) of type objec t.Object to Object -- |
February 13, 2007 [Issue 735] forward reference to type Object?? | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=735 ------- Comment #4 from davidl@126.com 2007-02-12 20:47 ------- the following represents the bug : simplified case: buginawhole.d extern(D) Object _d_newclass(ClassInfo a); class testclass{ template getCtor(TInterface, char[] classname,T...) { static ClassInfo typeClass; static Object function (T, Object) rawCtor; static TInterface internalCtor(T t) { Object a = _d_newclass(typeClass); rawCtor(t, a); return cast(TInterface)a; } TInterface function(T) getCtor() { return &internalCtor; } } } interface ITestClass { void callable(); } void main() { auto testLibrary = new testclass; auto testCtor = testLibrary.getCtor!(ITestClass,"test.testmodule.TestClass")(); } modulefault.d(8): Error: forward reference to type Object modulefault.d(8): Error: cannot implicitly convert expression (a) of type object .Object to Object -- |
February 15, 2007 [Issue 735] forward reference to type Object?? | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=735 braddr@puremagic.com changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|critical |normal Version|1.005 |0.178 -- |
July 02, 2007 [Issue 735] forward reference to type Object?? | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=735 ------- Comment #5 from onlystupidspamhere@yahoo.se 2007-07-02 13:26 ------- I can't reproduce any of the forward reference errors with DMD 1.018. Has this been fixed already? -- |
July 05, 2007 [Issue 735] forward reference to type Object?? | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=735 onlystupidspamhere@yahoo.se changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |WORKSFORME ------- Comment #6 from onlystupidspamhere@yahoo.se 2007-07-05 11:35 ------- Cannot reproduce any forward reference errors so works for me. -- |
Copyright © 1999-2021 by the D Language Foundation