Skip to content

emitBarf generates incorrect barf() call on wasm target

emitBarf generates a ccall in Cmm that calls barf() with a single literal string argument. However, barf() is a variadic C function, and this works on other platforms only because their C ABI happens to permit calling barf() as if it's defined as void barf(char*);. But not on wasm.

We should have a non-variadic wrapper for barf() in the RTS, and call that wrapper whenever a single string argument is to be passed. This will fix the occasional wasm-ld: warning: function signature mismatch: barf warnings, especially when -dtag-inference-checks is enabled.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information