Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

javascript tests fail with the error "TypeError: Mod._malloc is not a function" #6709

Closed
gbagan opened this issue May 5, 2023 · 0 comments · Fixed by #6712
Closed

javascript tests fail with the error "TypeError: Mod._malloc is not a function" #6709

gbagan opened this issue May 5, 2023 · 0 comments · Fixed by #6712

Comments

@gbagan
Copy link
Contributor

gbagan commented May 5, 2023

Hi,

I have tried to pass javascript/wasm API tests.
So I have installed Emscripten and run npm run build:wasm and npm run build:ts.
Both these commands succeed but, when I ran npm run test, almost all test fails with the error
TypeError: Mod._malloc is not a function

Finally I have succeed to pass the tests by adding _malloc on file scripts/build-wasm.ts line 43:
const extras = ['_malloc', '_set_throwy_error_handler', '_set_noop_error_handler', ...asyncFuncs.map(f => '_async_' + f)];

I am not sure it is the best solution but at least it works.

I can submit a PR if necessary.

gbagan added a commit to gbagan/z3 that referenced this issue May 6, 2023
NikolajBjorner pushed a commit that referenced this issue May 6, 2023
* implement  Optimize class for the high level Typescript API

* javascript and wasm: add _malloc to exported functions

fix the bug #6709

* javascript: add tests for the Optimize class

* javascript: no reason that minimize and optimize must be constants
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant