Skip to content

ENH: fix wasm32 runtime type error in numpy._core #27669

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

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

charris
Copy link
Member

@charris charris commented Oct 30, 2024

Backport of #27663.

As per python spec getters accept two arguments, second being closure context.
In descriptor.c numpy follows it, while in patched file it did not.

Why is it important? I was compiling for wasm32-wasip1 (I know that it is not supported), and expression str(np.dtype("float32")) gives runtime error due to incompatible function pointer type (omitting an argument), because it boils down to calling ._legacy getter. After this patch the snippet works. This issue is (probably) not observable in emscripten due to ifdef in the place that handles getters in cpython

The error is caused by function pointer type mismatch in call.indirect
@charris charris added this to the 2.1.3 release milestone Oct 30, 2024
@charris charris merged commit 5895c02 into numpy:maintenance/2.1.x Oct 30, 2024
65 checks passed
@charris charris deleted the backport-27663 branch October 30, 2024 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants