Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

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

Merged
charris merged 1 commit into
numpy:maintenance/2.1.xfrom
charris:backport-27663
Oct 30, 2024
Merged

charris merged 1 commit into
numpy:maintenance/2.1.xfrom
charris:backport-27663

Conversation

@charris

@charris charris commented Oct 30, 2024

Copy link
Copy Markdown
Member

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
@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