Conversation
|
Hi thanks for submitting this. Interesting... I was actually just looking at those pesky AA's myself. I do wonder if this shouldn't be fixed language-wide. There are likely more places where people use single field structs. In any case, let me try it out over the next few days. |
|
I had a look at this. It indeed seems that in some cases the calling convention doesn't add up. I did a quick tests with some standalone functions and a little I worked around it by replacing all I intend to fix it by diving deeper into the calling convention mismatch, but I first want to finish passing all (applicable) druntime and phobos tests first, as well as updating to the latest version of druntime/phobos/ldc. When I have the code pass the tests I will push here. |
In wasm, a struct that wraps a single value is treated differently than just that single value by itself in the calling convention. This was causing issues when functions such as
_aaLenwould be called with anImpl*value, which was then trying to be re-interpreted as anAA, meaning that the function would get garbage input.This PR removes the
struct AAdefinition, since it was just a wrapper around a single value, and thus fixes these issues.