binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

[C API] Some BinaryenString* functions declared in binaryen-c.h without implementation

Open leobuskin opened this issue 11 months ago • 3 comments

  • BinaryenStringIterNext
  • BinaryenStringIterMove
  • BinaryenStringSliceIter
  • BinaryenStringNewSetTry
  • BinaryenStringWTF8Advance

My FFI tooling breaks on those. Looks like there's no implementation, just declaration. Am I missing some compilation flags?

I've tried to find related commits (in case they were removed), but GitHub search wasn't helpful

leobuskin avatar Feb 19 '25 06:02 leobuskin

Those do appear to be missing implementations. Declarations were added in 0821cd10da but I guess those were forgotten. It would be good to add them now if someone has time.

kripken avatar Feb 21 '25 00:02 kripken

Implementations of BinaryenStringIterNext, BinaryenStringIterMove, and BinaryenStringSliceIter were added in https://github.com/WebAssembly/binaryen/commit/0821cd10da9ca81371688e132ed17164f23ea889, but for some reason they were later removed.

GulgDev avatar Apr 14 '25 07:04 GulgDev

These would be good to add, but note that we now have a StringLifting pass. One can emit imported strings, then lift them into the String* instructions, so it is less important to emit String* instructions directly (in fact, most toolchains might prefer not to, since VMs don't support them).

kripken avatar Apr 15 '25 22:04 kripken