Bug 3392 – a cast of this to void in tango.core.Thread is not allowed

Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2009-10-13T04:40:00Z
Last change time
2014-04-18T09:12:03Z
Assigned to
nobody
Creator
fawzi

Comments

Comment #0 by fawzi — 2009-10-13T04:40:50Z
Tango does not compile (just ./build/build.sh ), but stops with an error {{{ .../Thread.d(659): Error: e2ir: cannot cast from tango.core.Thread.Thread to void* }}} this is just a cast of this to void*, even rewriting the lines like this {{{ void *arg=cast(void*)cast(Object)this; if( pthread_create( &m_addr, &attr, &thread_entryPoint, arg ) != 0 ) }}} gives an error casting this. Unfortunately just about any reduced example work... both 1.048 and 1.049 have this issue, it is a blocker for tango.
Comment #1 by matti.niemenmaa+dbugzilla — 2009-10-13T05:35:44Z
Reduced testcase: class Foo { Foo next; void start() in { assert (!next); } body { void* p = cast(void*)this; } }
Comment #2 by bugzilla — 2009-10-13T19:59:34Z
A patch to dmd is in svn now.
Comment #3 by fawzi — 2009-10-14T01:49:24Z
thanks!
Comment #4 by moritzwarning — 2009-10-14T06:39:49Z
Works with r208. Thanks!
Comment #5 by clugdbug — 2009-10-21T06:39:49Z
Fixed DMD1.050 and DMD2.035.