Skip to content

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

Merged
keithw merged 3 commits into
mainfrom
fix-leb128-pr
Jun 9, 2023
Merged

keithw merged 3 commits into
mainfrom
fix-leb128-pr

Conversation

@keithw

@keithw keithw commented Jun 9, 2023

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@sbc100 sbc100 left a comment

Copy link
Copy Markdown
Member

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