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

src/leb128.cc: fix detection of too-big u64 LEB128s #2256

Merged
merged 3 commits into from
Jun 9, 2023
Merged

Conversation

keithw
Copy link
Member

@keithw keithw commented Jun 9, 2023

Fixes #2192

@keithw keithw requested a review from sbc100 June 9, 2023 06:51
@@ -0,0 +1,25 @@
;;; TOOL: run-interp-spec
;;; ARGS: --enable-memory64
Copy link
Member

Choose a reason for hiding this comment

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

Can we write this test without depending on --enable-memory64.

How about just a simple i64.const instruction?

Also, I guess this points to gap in the spec tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

Can we write this test without depending on --enable-memory64

Unfortunately not, because the bug was in ReadU64Leb128. :-( Those are only used by memory64 (for memory min, memory max, and load/store offset -- but the first two are in units of pages, so limited to 2^48 anyway). The const literals are using signed Leb128s, e.g. ReadS64Leb128.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let me try to submit this to the memory64 proposal repo...

Copy link
Member

Choose a reason for hiding this comment

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

OK.. maybe add a comment to that effect.

Copy link
Member Author

Choose a reason for hiding this comment

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

Submitted PR here: WebAssembly/memory64#38

Copy link
Member Author

Choose a reason for hiding this comment

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

OK.. maybe add a comment to that effect.

Done.

Copy link
Member

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

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

lgtm % comment

@keithw keithw enabled auto-merge (squash) June 9, 2023 18:21
@keithw keithw merged commit f1f3d6d into main Jun 9, 2023
@keithw keithw deleted the fix-leb128-pr branch June 9, 2023 19:07
@keithw keithw mentioned this pull request Oct 24, 2023
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.

Copy/paste bug in ReadU64LEB128
2 participants