--- Comment #2 from Don <> 2010-05-10 02:00:27 PDT ---
druntime currently relies on this behaviour in one place, and it's pretty nasty
code. For example, it assumes pointers are 32 bits long.

These both cast a void[] to a ulong.

Instead of:
        result = cast(ulong)foo(ti, pdim, ndims);
should be: 
        static assert((void[]).sizeof == ulong.sizeof);       
        void[] r = foo(ti, pdim, ndims);
        result = *cast(ulong *)&r;

In fact, this is a very ugly bit of code. It only seems to be used in e2ir.c,
NewExp::toElem(), where there's another hack to get the .ptr out of the ulong.
I don't see any reason why extern(D) couldn't be used instead, so that it could
just return an array.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to