WebAssembly + Custom Runtime + Associative Arrays

Remi remigillig at gmail.com
Wed Nov 11 08:30:09 UTC 2020


On Wednesday, 11 November 2020 at 02:05:25 UTC, kinke wrote:
> Ouch, it's compiler bug - the compiler's hardcoded prototype 
> for _aaInX() uses a `void*` as first param, not a `AA` struct 
> wrapping the impl pointer. So this assumes the ABI/calling 
> convention treats both types identically, which isn't currently 
> the case for LDC's wasm ABI.
>
> So using `void* _aaInX(AAImpl* aaimpl, ...)` works around this.

That's kind of what I saw, AA* worked in x86 but AA** worked in 
WASM and vice versa. I did try to find where the compiler 
actually generated the call to _aaInX but couldn't find it by a 
simple search. Thanks for the help, it seems to work in both 
architectures now :)


More information about the digitalmars-d-ldc mailing list