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

wat-writer.cc: resolve missing type index in call_indirect #2278

Merged
merged 1 commit into from
Aug 1, 2023

Conversation

keithw
Copy link
Member

@keithw keithw commented Jul 31, 2023

Fixes #2270

@keithw keithw requested a review from sbc100 July 31, 2023 21:07
@@ -0,0 +1,24 @@
;;; TOOL: wat-desugar
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this issue only effect wat-desugar? From the change it looks like it would also effect wasm2wat?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the BinaryReaderIR is never going to make a CallIndirect Expr where decl.has_func_type is false, because the binary format always has a sig_index right there physically. So I think the only way this can happen is if the Module originated as WAT and is being written out again as WAT. (Which afaik only happens in wat-desugar.) FWIW the BinaryWriter always does this lookup unconditionally.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should just drop wat-desugar completely.. and have folks use wat2wasm + wasm2wat to get this effect? Is this tool worth maintaining on its own?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No objection from me to getting rid of wat-desugar. I doubt it gets a lot of use. But we should probably fix this WatWriter issue either way. :-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure this lgtm either way.

@keithw keithw merged commit 3d1d29f into main Aug 1, 2023
28 of 29 checks passed
@keithw keithw deleted the wat-writer-call-indirect branch August 1, 2023 00:00
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 this pull request may close these issues.

desugar: overflow issue for typeidx of call_indirect instruction
2 participants