binaryen.js icon indicating copy to clipboard operation
binaryen.js copied to clipboard

module.getMemorySegmentInfoByIndex is not a function

Open lastmjs opened this issue 8 months ago • 3 comments

I just updated from binaryen from version 116.0.0 to 123.0.0. I have not changed any of my source code. I now get this error:

module.getMemorySegmentInfoByIndex is not a function

binaryen's index.d.ts file lists this function as available, so I have no TypeScript errors. But when I log my created module object, I do not see getMemorySegmentInfoByIndex. I do however see getMemorySegmentInfo.

lastmjs avatar Jun 27 '25 14:06 lastmjs

This seems like a major blocking issue for us. How do I get the memory segment infos now? I can't see any way to dynamically get the memory segment names. Indexes do not work, whether they are numbers or strings.

The only way I have been able to get the memory segment infos from getMemorySegmentInfo has been to emit a .wat file and manually look at the memory segment names to hard-code them. But of course we need to do this dynamically.

Before, using a combination of getNumMemorySegments and getMemorySegmentInfo yielded the memory segment infos that we needed. I no longer see an equivalent to that functionality.

lastmjs avatar Jun 27 '25 17:06 lastmjs

@lastmjs so module.getMemorySegmentInfo(String(i)) isn't working?

CountBleck avatar Jun 27 '25 20:06 CountBleck

Indexes do not work, whether they are numbers or strings.

@CountBleck I don't think so

lastmjs avatar Oct 08 '25 17:10 lastmjs