newCTFE Status July 2017

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Sat Jul 15 04:12:22 PDT 2017


On Thursday, 13 July 2017 at 12:45:19 UTC, Stefan Koch wrote:
> [ ... ]


I fixed my struct ABI issues for now.

The problem was the lowering of the IR types.
Since before everything was expressible as pointer, it was fine 
to convert everything to integers and treat them as pointer.

Since structs treated are value-types now we can no longer just 
point to them.
However due to the premature conversion we would stick random 
intgeres with the pointer values inside the struct.

This is what should happen:
*(cast (struct_t*)targetMemory) = *(cast(struct_t*) sourceMemory);

And this is what actually did happen:

*(cast(size_t*) targetMemory) = cast(size_t) sourceMemory;

Due to bizarre coincidences this wrong behavior would actually 
pass a few tests which were supposed to catch this mistake :)

long story short. This bug is now fixed.

I am assuming that there are still a few issues with 
arrayLiterals.
But I will fix those another day.

I am spent.

Have a nice day,
Stefan.


More information about the Digitalmars-d mailing list